Importing from Spreadsheet

Once populated, the Excel Data file can be imported into R, for example:

MyData <- XL2Data('MyData')

We will use some of the example Data files included in the MSEtool package.

One example Data file is the China rockfish. You can download this Data file to your current working directory and import into R:

China_rockfish <- XL2Data("China_rockfish.csv")

The CSV files for the other example Fishery Data objects are also included in the MSEtool package. To find the location where these files are located on your machine, use the DataDir function:

list.files(DataDir(), pattern=".csv")
## [1] "Atlantic_mackerel.csv"  "China_rockfish.csv"     "Cobia.csv"             
## [4] "Gulf_blue_tilefish.csv" "ourReefFish.csv"        "Red_snapper.csv"

You can then load one of the example CSV files using the XL2Data function:

China_rockfish2 <- XL2Data(DataDir('China_rockfish'))

or the new function:

China_rockfish2 <- new("Data", DataDir('China_rockfish'))

Alternatively, you can navigate to the data directory (DataDir()) on your machine and examine the contents and structure of the CSV data files in MS Excel or other software.