This is a simple wrapper to read.table
that reads in a text file with ring-width data in "spreadsheet" format. I.e., with series in columns and the the years as rows. The first column should contain the years and each subsequent column should contain a tree-ring series. The series names should be in the first row of the file. The deafult for NA
values are empty cells or as the character string "NA"
but can also be set using the na.strings
argument passed to read.table
. E.g.,:
Year | Ser1A | Ser1B | Ser2A | Ser2B |
1901 | NA | 0.45 | 0.43 | 0.24 |
1902 | NA | 0.05 | 0.00 | 0.07 |
1903 | 0.17 | 0.46 | 0.03 | 0.21 |
1904 | 0.28 | 0.21 | 0.54 | 0.41 |
1905 | 0.29 | 0.85 | 0.17 | 0.76 |
1906 | 0.56 | 0.64 | 0.56 | 0.31 |
1907 | 1.12 | 1.06 | 0.99 | 0.83 |
Note that this is a rudimentary convenience function that isn't doing anything sophisticated. It reads in a file, assigns the years to the row names and sets the class of the object to c("rwl","data.frame")
which allows dplR
to recognize it.
Although arguments can be passed to read.table
, this is not designed to be a flexible function. As is the philosophy with dplR
, modifying the code is easy should the user wish to read in a different style of text file (e.g., tab delimited). Typing csv2rwl
at the R
prompt will get the user started.