Thomas, perhaps:
data <- readRAST6(map_list[[1]])
as map_list is a list, and readRAST6 seems to want a character vector,
which is in the first list element of map_list.
Thomas Adams wrote:
All:
With sp & spgrass6 I have no problem reading a list of maps with
readRAST6 when I do the following:
data<-readRAST6(c("map1","map2","map3",?))
however, I need to do this dynamically within a script, for example:
inputfile<-Sys.getenv("R_INPUT_FILE")
map_list<-scan(inputfile,list(""))
[[1]]
[1] "sref_em.t09z.pgrb212.ctl" "sref_em.t09z.pgrb212.n1"
[3] "sref_em.t09z.pgrb212.n2" "sref_em.t09z.pgrb212.p1"
[5] "sref_em.t09z.pgrb212.p2" "sref_eta.t09z.pgrb212.ctl1"
[7] "sref_eta.t09z.pgrb212.ctl2" "sref_eta.t09z.pgrb212.n1"
[9] "sref_eta.t09z.pgrb212.n2" "sref_eta.t09z.pgrb212.p1"
[11] "sref_eta.t09z.pgrb212.p2" "sref_nmm.t09z.pgrb212.ctl"
[13] "sref_nmm.t09z.pgrb212.n1" "sref_nmm.t09z.pgrb212.n2"
[15] "sref_nmm.t09z.pgrb212.p1" "sref_nmm.t09z.pgrb212.p2"
[17] "sref_rsm.t09z.pgrb212.ctl1" "sref_rsm.t09z.pgrb212.n1"
[19] "sref_rsm.t09z.pgrb212.n2" "sref_rsm.t09z.pgrb212.p1"
[21] "sref_rsm.t09z.pgrb212.p2"
data<-readRAST6(map_list)
spplot(data,?)
What happens is that "map_list" is treated literally, not as:
data<-readRAST6(c("map1","map2","map3",?)) which works. I have tried a
number of things, such as:
data<-readRAST6(as.list(map_list))
data<-readRAST6(c(map_list))
data<-readRAST6(as.vector(map_list))
data<-readRAST6(eval(map_list))
How do I do this?
Regards,
Tom