Displaying 5 results from an estimated 5 matches for "fekete_".
Did you mean:
fekete
2009 Mar 27
2
Assignment to variables fails to loop
...ere in writing R code which will read in files with two variable parts to the file name and then assigning these file names to objects, which also have two variable parts. I have got the code running without encountering errors, however, I receive 50+ of the same warnings:
1: In assign(paste("Fekete_", index$year, index$month, sep = ""), ... :
only the first element is used as variable name
And it's true, when I do ls() only Fekete198601 has been assigned. I've attempted to rectify this, but have only come up against further errors.
The code as it stands, is as follo...
2009 Mar 31
0
Row/columns names within 'assign' command
...reated as follows:
# Create table indexes
index <- expand.grid(year = sprintf("%04d", seq(1986, 1995)), 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=F...
2009 May 01
1
Problems with 'valid columns' when using merge
...to the 'by' argument of the command, as follows:
> merge_year <- 1986
>
> for (i in 1:10) { # Number of file pairs
+ assign(paste("merged_arunfek_", merge_year, sep=""), merge(x=paste("arunoff_",start_arunoff, sep=""), y=paste("fekete_", start_fekete, sep=""), by=c("Latitude", "Longitude"), sort=FALSE))
+ attach(paste("merged_arunfek_", merge_year))
+ merge_year = merge_year+1
+ }
Error in fix.by(by.x, x) : 'by' must specify valid column(s)
However, as far as I ca...
2009 Mar 31
1
Reshape: 'melt' numerous objects
...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...
> assign(paste("Fekete_table_temp", index$year[i], index$month[i], sep='')$Latitude,rownames(Fekete_198601)) # Using the row names of a given file
Error in paste("Fekete_table_temp", index$year[i], index$month[i], sep = "")$Latitude :
$ operator is invalid for atomic vectors
To get...
2009 Apr 01
0
回复: R-help Digest, Vol 73, Issue 32
...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's horrible coding (especially as it relies on the first 120 objects stored in the memory actually being the objects I want to use)...
files
[1] "Fekete_198601" "Fekete_198602" "Fekete_198603" "Fekete_198604"
[5] "Fekete_198605" "Fekete_198606" "Fekete_198607" "Fekete_198608"
[9] "Fekete_198609" "Fekete_198610" "Fekete_198611" "Fekete_19...