Skip to content
Prev 195764 / 398500 Next

Paste a character to an object

David,

Thanks, that helps me in making an example of what I am trying to do.  Given the following example, I would like to run through a for loop and obtain a vector of the data only for the 100, 75, and 50 percent values.  Is there a way to get this to work, either using paste as in the example below or some other method?

homerange <- list()
homerange[[1]] <- "test"
homerange[[1]]$polygons <- "test2"
homerange[[1]]$polygons$`100` <- rnorm(20,10,1)
homerange[[1]]$polygons$`90` <- rnorm(20,10,1)
homerange[[1]]$polygons$`75` <- rnorm(20,10,1)
homerange[[1]]$polygons$`50` <- rnorm(20,10,1)

xx<-c()
percent<-c("100","75","50")
for (i in 1:length(percent))
{
x<-paste(homerange[[1]]$polygons$,percent[i]) #This does not work!!!
xx<-rbind(x,xx)
}

The x<-paste(...) in this function does not work, and that is what I am stuck on.  The result should be a vector the values for the "100","75",and "50" levels, but not the "90" level.

Aloha,

Tim




Tim Clark
Department of Zoology 
University of Hawaii
--- On Sat, 10/3/09, David Winsemius <dwinsemius at comcast.net> wrote: