Yet another possibility is to iterate on both values and names simultaneously
using mapply():
df1 <- split(
x=rnorm(n=100, sd=seq(from=1, to=10, each=10)),
f=letters[seq(from=1, to=10, each=10)]
)
mapply(function(x, y) plot(x, ylab=y), df1, names(df1))
Enrique
-Original Message---
Hi,
The do.call() version is likely slower than the vector version.
To select multiple rows, just replace the 1 by the vector with the rows.
The TRUEs in the list fail if the array happens to have 0 length in the
corresponding dimension. You can build the list passed to do.call() first
setting
Hi Brian,
In general, R lacks many utilities for "applications". I'd say
it's more focused on "one-shot" analysis, what is logic given its
origin in statistics/academics. Few packages deal with these types
of "application automation".
Logging is already addressed in some packages: you should ha
Hi,
This may be due to several reasons. That I can think about:
1) Ensure you close *all* possibly open workbooks:
nBooks <- xl[["Workbooks"]]$Count();
for (i in seq_len(nBooks))
xl[["Workbooks"]]$item(i)$Close(SaveChanges=FALSE);
2) The excel application referen
Hi,
On windows, you can use a COM client (with packages like rcom or RDCOMClient)
to control powerpoint from R and insert the generated image using powerpoint's
object model. You can either use the clipboard or an intermediate image file
saved to disk.
Not hard to do, but this seems to be alre
mapply(function(x, class) match.fun(paste("as", class,
> sep="."))(x), x, colClasses("Dif"), SIMPLIFY=FALSE), stringsAsFactors=FALSE)
Enrique
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: jueves, 25 de junio d
Hi Mark,
I frequently need to do that when importing data. This one-liner works:
> data.frame(mapply(as, x, c("integer", "character", "factor"),
> SIMPLIFY=FALSE), stringsAsFactors=FALSE);
but it has two problems:
1) as() is an S4 method that does not always work
2) writting the vector of cla
> How can I create a legend that is fully outside of the plot, similar to
> what excel does by default, for example?
The common solution with traditional plots (pre-modifying the margin) works
well for a one-shot plot, where you calculate the legend size by
trial-and-error.
The problem arises w
Hi, I'm trying to show categories labels on the y-axis of a lattice barchart
left-aligned instead of the default right-aligned.
That is, in the following example code:
x <- c(14.16, 9.98, 14.59, 15.24)
names(x) <- c("Banks & Finance", "Technology", "Non-Cyclicals",
"Communications")
9 matches
Mail list logo