[R] Putting directory path as a parameter

2011-11-15 Thread aajit75
Hi List, I am new to R, this may be simple. I want to store directory path as parameter which in turn to be used while reading and writing data from csv files. How I can use dir defined in the below mentioned example while reading the csv file. Example: dir - C:/Users/Desktop #location of

Re: [R] Putting directory path as a parameter

2011-11-15 Thread Joshua Wiley
Hi Aajit, try using the ?paste function to combine the variable with your directly and the filename into one string, and then pass that to read.csv() or whatever paste(dir, /bs_dev_segment_file.csv, sep = '') HTH, Josh On Tue, Nov 15, 2011 at 6:12 AM, aajit75 aaji...@yahoo.co.in wrote: Hi

Re: [R] Putting directory path as a parameter

2011-11-15 Thread R. Michael Weylandt michael.weyla...@gmail.com
Try pasting them together like paste(dir, ...) You may need to use the collapse argument. Alternatively, change your working directory to dir with setwd(). M On Nov 15, 2011, at 9:12 AM, aajit75 aaji...@yahoo.co.in wrote: Hi List, I am new to R, this may be simple. I want to store

Re: [R] Putting directory path as a parameter

2011-11-15 Thread Henrik Bengtsson
file.path() is much better for this than paste(), e.g. dir - C:/Users/Desktop pathname - file.path(dir, bs_dev_segment_file.csv) temp_data - read.csv(pathname) /Henrik On Tue, Nov 15, 2011 at 10:08 AM, R. Michael Weylandt michael.weyla...@gmail.com michael.weyla...@gmail.com wrote: Try pasting