First create a tiny data set in Excel:
# comments at the top
# beaucoup metadata
ID, Treatment, Biomass, Notes
1, Control, 30.3,
2, HighN, 13.0,
3, HighN, NA, broken scale
4, Control, 35.3,
read.table
to bring in datawrite.table
to export to a data fileBut this is not a good way to save or share data objects if we are
working in R. Some researchers use the save()
function,
which preserves the whole environment, but once it is restored with
load()
, the variable names cannot be changed. It is better
to use `saveRDS().
saveRDS()
: useful when you are working only in RThis only saves a single R object as a binary, but remember, you can bundle up many things into a single list!
Use readRDS()
to restore it.