Displaying 3 results from an estimated 3 matches for "comp_runoff_hd_".
2009 Mar 27
2
Assignment to variables fails to loop
...# READ IN FILES FROM DISK
# File names have two variable parts: creating a 'file index' is a two-step process
index <- expand.grid(year = sprintf("%04d", seq(1986, 1995)), month = sprintf("%02d", 1:12))
filelist <- paste("C:\\Documents and Settings\\Data\\comp_runoff_hd_", paste(index$year, index$month, sep=''), '.asc', sep='')
filelist
# Assign file names to individual objects with variable name components
for (i in filelist) {
assign(paste("Fekete_",index$year, index$month, sep=''),read.table(file=i, he...
2009 Mar 31
0
Row/columns names within 'assign' command
...95)), month = sprintf("%02d", 1:12))
# Read in and assign file names to individual objects with variable name components
for (i in seq(nrow(index))) {
assign(paste("Fekete_",index$year[i], index$month[i], sep=''),
read.table(file=paste("C:\\Data\\comp_runoff_hd_", index$year[i], index$month[i], ".asc", sep=""), header=FALSE, sep=""))
# Create index of file names
files <- print(ls()[1:120], quote=FALSE) # This is the best way I could manage to successfully attribute all the table names to a single list - I realise it...
2009 Apr 01
0
回复: R-help Digest, Vol 73, Issue 32
...month = sprintf("%02d", 1:12))
# Read in and assign file names to individual objects with variable name components
for (i in seq(nrow(index))) {
assign(paste("Fekete_",index$year[i], index$month[i], sep=''),
read.table(file=paste("C:\\Data\\comp_runoff_hd_", index$year[i], index$month[i], ".asc", sep=""), header=FALSE, sep=""))
# Create index of file names
files <- print(ls()[1:120], quote=FALSE) # This is the best way I could manage to successfully attribute all the table names to a single list - I realise it...