Setting working directory for Rnw / latex in R -



Setting working directory for Rnw / latex in R -

hi trying utilize r , latex create pdf document info analysis.

in original *.r document have changed working directory multiple times refer data. reason changed working directory because have multiple files of same pattern , ldply function import multiple functions. since, had info on 2 folder, changed working directory 2 times each process. have shown sample illustration in next code.

setwd("d:\\model runs \\sediment/") sed_data = ldply(list.files(pattern="dat"),function(fname) { dum = read.table(fname,skip=1) #dum$fname = fname # adds filename read column return(dum) }) names(sed_data) <- c("lat","long","sed") seddata <- aggregate(sed~lat+long, sed_data,mean) dim(seddata) head(seddata) ## read dye info setwd("d:\\model runs \\dye") getwd() dye_data = ldply(list.files(pattern = "dat"), function(filename) { pum = read.table(filename,skip=1,sep=",") #dum$fname = fname # adds filename read column return(pum) })

how can prepare problem of referring problem in creating latex document ? how can refer working directory while working on *.rnw ?

**edit: using .rnw file , using sweave. possible create pdf using knitr ? *

r latex sweave

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -