On Tue, Mar 31, 2009 at 11:12 AM, Steve Murray <smurray...@hotmail.com> wrote:
>
> Dear R Users,
>
> I'm trying to use the reshape package to 'melt' my gridded data into column 
> format. I've done this before on individual files, but this time I'm trying 
> to do it on a directory of files (with variable file names) - therefore I 
> have to also use the 'assign' command. I have come up against a couple of 
> problems however and am therefore seeking advice...

I'd _strongly_ recommend you don't use assign.  Instead put everything
in a list:

paths <- dir("mydir", "\\.csv$", full.names = TRUE)
names(paths) <- basename(paths)

data <- lapply(paths, read.csv)
molten <- lapply(data, melt, id = "Latitude", na.rm=TRUE)

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to