Help with exporting data-please

I have obtained a dataset which can be read into GAUSS as below:

data = loadd("y_panel");
t = data[.,1];
y = data[.,2:cols(data)];

However, I am trying to open the data in excel or notepad but the format is not supported.

I would like to open in in Excel or notepad so that I can check the structure of the data.

After loading the data I tried this in GAUSS:

xlsWrite(y_panel, "my_xls_file", "A1", 1, "");

but get the error message:

Undefined symbols:
    y_panel

Any help, please?

Thanks

ozey

2 Answers



0



The Immediate Problem

I think that the main problem is a misunderstanding of this line of code below.

data = loadd("y_panel");

That line loads the data from the file y_panel.dat into a GAUSS matrix named, data. GAUSS only uses the string "y_panel" to find which file to load the data from.

When you are ready to write the data to Excel, with xlsWrite, the correct line would look like this:

// Write the GAUSS matrix 'data' to
// the Excel file 'my_xls_file.xlsx',
// starting at cell 'A1' on sheet 1
xlsWrite(data, "my_xls_file.xlsx", "A1", 1, "");

Other solutions

That should resolve your problem. However, there are a couple of other options that you might find simpler.

1. View the matrix on the Data Page

You can click on the Data tab on the left of GAUSS to see a list of all data in your GAUSS workspace. If you double-click on the name of the matrix, data in this case, GAUSS will show you the entire contents of the matrix.

GAUSS workspace variables.

2. Preview the data file from the Project Folders Window

Towards the bottom of this tutorial, are instructions showing how to open a folder in the Project Folders Window. If you do that, you can just double-click on the name of the data file in GAUSS and it will give you a preview of the data.

3. Print the data

You could also just enter the command:

// print all rows of the matrix named 'data'
print data;

aptech

1,773


0



Thanks very much for your help. The print option does show the structure.

Regards,

Ozey

Your Answer

2 Answers

0

The Immediate Problem

I think that the main problem is a misunderstanding of this line of code below.

data = loadd("y_panel");

That line loads the data from the file y_panel.dat into a GAUSS matrix named, data. GAUSS only uses the string "y_panel" to find which file to load the data from.

When you are ready to write the data to Excel, with xlsWrite, the correct line would look like this:

// Write the GAUSS matrix 'data' to
// the Excel file 'my_xls_file.xlsx',
// starting at cell 'A1' on sheet 1
xlsWrite(data, "my_xls_file.xlsx", "A1", 1, "");

Other solutions

That should resolve your problem. However, there are a couple of other options that you might find simpler.

1. View the matrix on the Data Page

You can click on the Data tab on the left of GAUSS to see a list of all data in your GAUSS workspace. If you double-click on the name of the matrix, data in this case, GAUSS will show you the entire contents of the matrix.

GAUSS workspace variables.

2. Preview the data file from the Project Folders Window

Towards the bottom of this tutorial, are instructions showing how to open a folder in the Project Folders Window. If you do that, you can just double-click on the name of the data file in GAUSS and it will give you a preview of the data.

3. Print the data

You could also just enter the command:

// print all rows of the matrix named 'data'
print data;

0

Thanks very much for your help. The print option does show the structure.

Regards,

Ozey


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy