Displaying 6 results from an estimated 6 matches for "splist".
Did you mean:
sglist
2015 Aug 25
2
match()/%in% with language objects?
...esign reason why I
can't use %in% (which is a wrapper for match()) on language objects.
I'd like to test whether a language object is in a list of language
objects, but I get the error "'match' requires vector arguments":
specials <- c("foo","bar")
spList <- lapply(specials,as.name) ## convert to language objects
"a" %in% spList ## works (FALSE)
spList[[1]] %in% spList ## 'match' requires vector arguments
quote(foo) %in% spList ## ditto
quote(foo) == spList[[1]] ## TRUE
obviously I can go the other way, converting my targ...
2015 Aug 26
1
match()/%in% with language objects?
...ALSE
> match(list(quote(1+2), quote(log2(16))), list(3, quote(1+2), c(4L,5L,6L,7L)))
> #[1] 2 NA
yes, or slightly more naturally for the first case,
> expression(1+2, log2(16)) %in% expression(3, 1+2, c(4L,5L,6L,7L))
[1] TRUE FALSE
> With your example data:
> spList[1] %in% spList
> #[1] TRUE
> list(quote(foo)) %in% spList
> #[1] TRUE
> list(quote(nosuchsymbol)) %in% spList
> #[1] FALSE
yes indeed, that works because list()s and expression()s are
"vector"s in the wide sense, as "we all" know.
Did you su...
2015 Aug 25
0
match()/%in% with language objects?
...quote(log2(16))) %in% expression(3, quote(1+2),
c(4L,5L,6L,7L))
#[1] TRUE FALSE
list(quote(1+2), quote(log2(16))) %in% list(3, quote(1+2), c(4L,5L,6L,7L))
#[1] TRUE FALSE
match(list(quote(1+2), quote(log2(16))), list(3, quote(1+2),
c(4L,5L,6L,7L)))
#[1] 2 NA
With your example data:
spList[1] %in% spList
#[1] TRUE
list(quote(foo)) %in% spList
#[1] TRUE
list(quote(nosuchsymbol)) %in% spList
#[1] FALSE
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Aug 25, 2015 at 9:12 AM, Ben Bolker <bbolker at gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>...
2017 Dec 07
2
parallel computing with foreach()
...ut in the current problem, it
is not working. Given the volume and type of the data involved in the
analysis, I will try to give below the complete code without reproducible
example.
In short, each R environment will draw a set of separate files, perform the
analysis and dump in separate folders.
splist <- c("juoc", "juos", "jusc", "pico", "pifl", "pipo", "pire", "psme")
covset <- c("PEN", "Thorn")
foreach(i = 1:length(splist)) %:%
foreach(j = 1:length(covset)) %dopar% {
spname <- splist[...
2017 Dec 07
0
parallel computing with foreach()
...not working. Given the volume and type of the data involved in the
> analysis, I will try to give below the complete code without reproducible
> example.
>
> In short, each R environment will draw a set of separate files, perform the
> analysis and dump in separate folders.
>
> splist <- c("juoc", "juos", "jusc", "pico", "pifl", "pipo", "pire", "psme")
> covset <- c("PEN", "Thorn")
>
> foreach(i = 1:length(splist)) %:%
> foreach(j = 1:length(covset)) %dopar% {
&g...
2009 Mar 27
3
color vectors other than gray()
...fferent cells of a grid (a shapefile)
will be painted with a color share scale, where the most easy way is to use
gray().
Can I somehow get a vector (gradient) of colors, a vector of colors with
other methods but gray()?
I'm doing this until now
quad_N_sp <-
merge(sp_dist[sp_dist$sp==splist[i],],grelha_ID,by.x="quad",by.y="quadricula
",all.y=T,)
quad_N_sp$x[is.na(quad_N_sp$x)] <- 0
quad_N_sp <- quad_N_sp[order(quad_N_sp$id),]
paleta <- gray(1-(quad_N_sp$x)/max(quad_N_sp$x)) #! Tons de cinzento
win.graph(4,5)
plot(grelha,ol="grey80&quo...