##############################################################
## ##
## Use this to convert comma separated values files (*.csv) ##
## in the data-raw directory of the fishWiDNR package to ##
## R data files (.rdata) in the data directory of the ##
## same package. ##
## ##
##############################################################
library(tools)
## Get all .csv files in the data-raw directory
setwd("C:/aaaWork/Programs/GitHub/fishWiDNR/data-raw")
raw <- list.files(pattern="*.csv")
#### Convert to .rdata files ####
## Cycle through each file to make it an RDA file
for (f in raw) {
print(f)
## Read file
nm <- file_path_sans_ext(f)
assign(nm,read.csv(f,stringsAsFactors=FALSE))
## Save as an .rdata file
save(list=nm,file=paste0("../data/",nm,".rdata"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.