Displaying 4 results from an estimated 4 matches for "arunoff_".
2009 Mar 25
4
Manual sort in a for loop
...oice (as shown by the row numbers in the code). I have been able to carry out each re-arrangement without the use of the 'for' loop, but cannot seem to successfully execute the statements when incorporated into the loop. The code I have is as follows:
table_year=1951
for (i in (paste("arunoff_",year,"_temp",sep=""))) {
assign(paste("arunoff_",table_year, sep=""),paste("arunoff_",table_year,"_temp")[c(10,7,9,5,4,12,1,3,2,8,11,6),])
table_year = table_year+1
}
The error I get is:
Error in past...
2009 Mar 26
1
Column name assignment problem
Dear all,
I'm trying to assign a name to the fourth column whilst using 'assign', but keep encountering errors. What have I done wrong?!
> assign(colnames(c(paste("arunoff_",table_year, sep="")[4]), "COUNT"))
Error in if (do.NULL) NULL else if (nc> 0) paste(prefix, seq_len(nc), :
argument is not interpretable as logical
Hope someone is able to help.
Thanks for any pointers,
Steve
__________________________________________________...
2009 May 01
1
Problems with 'valid columns' when using merge
...;merge' within a loop, however, I receive an error relating 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) : '...
2009 Apr 01
0
回复: R-help Digest, Vol 73, Issue 32
...cinct. I'm trying to do this via the 'levels' command as I figured that I might be able to apply the character strings in a similar way to how you recommended when dealing with 'colnames'.
# Refine names of rivers to make more succinct
riv_names <- get(paste("arunoff_",table_year, sep=''))[,1]
levels(riv_names) <- c("AMAZON", "AMUR", "CONGO", "LENA", "MISSISSIPPI", "NIGER", "NILE", "OB", "PARANA", "YANGTZE", "YENISEI", "ZAM...