[R] Problem with loop in folders

2020-04-24 Thread Shubhasmita Sahani
ot;) df <- read.dbf(dbf) dbfname<-basename(dbf) name<-file_path_sans_ext(dbfname) # get the name of the file like agra_ward write.csv( df, file = paste0("csvpath",name,"csv")) print(path) } -- Thanks & Regards, Shubhasmita Sahani [[altern

Re: [R] need help in if else condition

2019-07-10 Thread Shubhasmita Sahani
t;) > > Following the comments above would lead to code such as > > de <- data.frame(d,e,stringsAsFactors=FALSE) > de$f <- de$d > de$f[ de$d %in% c("-","dnr","post") ] <- 0 > > HTH, > Eric > > > > > > > On Wed,

[R] need help in if else condition

2019-07-10 Thread Shubhasmita Sahani
) de<- as.data.frame(cbind(d,e)) de$f<-ifelse (de$d=="-"|de$d=="dnr"|de$d=="post",0,de$d) head(de) d e f 1 1 2 2 2 2 2 4 3 3 3 5 4 - 4 0 5 dnr 5 0 6 post 6 0 why the values are changing in with if else condition -- Thanks & R