[R] Issue replacing dataset values from read data

2016-05-06 Thread Chang, Emily
Dear all, I am reading a modest dataset (2297 x 644) with specific values I want to change. The code is inelegant but looks like this: df <- read.csv("mydata.csv", header = TRUE, stringsAsFactors = FALSE) # yrsquit, packyrs missing for following IDs. Manually change. for(myid in c(2165, 2534, 2

[R] Changing many csv files using apply?

2012-06-18 Thread Chang, Emily@OEHHA
Dear all, I have many csv files whose contents I want to change a bit en masse. So far, I've written code that can change them in a for loop, like so: # Subset of files in the folder I want to change subset = "somestring" # Retrieve list of files to change filelist=list.files() filelist = fileli