similar to: Problems with lattice-histograms or png within loops

Displaying 20 results from an estimated 3000 matches similar to: "Problems with lattice-histograms or png within loops"

2004 Dec 10
1
lattice graphics empty in Sweave
Hello, I have problems using lattice graphics together with Sweave under Windows XP and R 2.0.0; 2.0.1 Patched; 2.1.0 devel respectively. Base graphics are o.k., but for lattice graphics empty files (.eps and .pdf) are generated. The only workaround I found was to write and read the respective figures explicitely using postscript() and includegraphics{}. Have I missed something to solve this
2012 Dec 09
1
defmacro and bwplot incompatibilities?
My macro doesn't work for bwplot. But is working elsewhere. What changes should i make to fix my macro. Thanks. The complete code sample is: library(gtools) library(lattice) pic <- defmacro(fn, plotfunc, expr={png(filename=fn); plotfunc; dev.off()}) # this one fails. pic("bw.png", {bwplot(Species ~ Sepal.Length, data=iris)}) # this one works pic("p.png",
2007 Aug 30
2
Need help putting histograms on the diagonal of a splom plot
Hello, I am in need of help in putting histograms on the diagonal of a plot produced with splom(). The plot matrix I am trying to produce is to have standard scatterplots in the upper-left triangle, contour plots in the lower-right triangle, and histograms on the diagonal. I have a function that does the first two, but the histograms on the diagonal has been beyond my ability. Here is my
2012 Apr 25
1
recommended way to group function calls in Sweave
Dear all When using Sweave, I'm always hitting the same bump: I want to group repetitive calls in a function, but I want both the results and the function calls in the printed output. Let me explain myself. Consider the following computation in an Sweave document: summary(iris[,1:2]) cor(iris[,1:2]) When using these two calls directly, I obtain the following output: > summary(iris[,1:2])
2006 May 31
2
a problem 'cor' function
Hi list, One of my co-workers found this problem with 'cor' in his code and I confirm it too (see below). He's using R 2.2.1 under Win 2K and I'm using R 2.3.0 under Win XP. =========================================== > R.Version() $platform [1] "i386-pc-mingw32" $arch [1] "i386" $os [1] "mingw32" $system [1] "i386, mingw32" $status
2012 Jun 11
1
saving sublist lda object with save.image()
Greetings R experts, I'm having some difficulty recovering lda objects that I've saved within sublists using the save.image() function. I am running a script that exports a variety of different information as a list, included within that list is an lda object. I then take that list and create a list of that with all the different replications I've run. Unfortunately I've been
2012 Jul 31
1
kernlab kpca predict
Hi! The kernlab function kpca() mentions that new observations can be transformed by using predict. Theres also an example in the documentation, but as you can see i am getting an error there (As i do with my own data). I'm not sure whats wrong at the moment. I haven't any predict functions written by myself in the workspace either. I've tested it with using the matrix version and the
2007 Mar 22
2
unexpected behavior of trellis calls inside a user-defined function
I am making a battery of levelplots and wireframes for several fitted models. I wrote a function that takes the fitted model object as the sole argument and produces these plots. Various strange behavior ensued, but I have identified one very concrete issue (illustrated below): when my figure-drawing function includes the addition of points/lines to trellis plots, some of the
2008 Oct 13
2
split data, but ensure each level of the factor is represented
Hello, I'll use part of the iris dataset for an example of what I want to do. > data(iris) > iris<-iris[1:10,1:4] > iris Sepal.Length Sepal.Width Petal.Length Petal.Width 1 5.1 3.5 1.4 0.2 2 4.9 3.0 1.4 0.2 3 4.7 3.2 1.3 0.2 4 4.6 3.1 1.5
2007 Oct 09
2
lattice/xyplot: horizontal y-axis labels with scales(relation="free")
I would like to create an xyplot with varying y-axis limits and horizontal labels at the y-axis tickmarks. The following does not seem to work, although I think it should, going by the documentation for par. R version 2.5.1, Windows XP Prof. Thanks for a clue. Andreas Krause library(lattice) # axis labels for y-axis are horizontal xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris) #
2011 Mar 06
4
sorting & subsetting a data.frame
Dear all This may be obvious, but I cannot get it working. I'm trying to subset & sort a data frame in one go. x <- iris x$Species1 <- as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine with(x, x[order(Sepal.Length, rev(sort(Species1))),]) ##gets subsetted, but not sorted as expected with(x, x[(Sepal.Length==6.7) &
2009 Apr 08
2
Doubt about aov and lm function... bug?
Hi, The below very strange: # a) aov function av <- aov(Sepal.Length ~ Species, data=iris) # Error in parse(text = x) : # unexpected symbol in "Sepal(Sepal.Length+Species)Length" av <- aov(iris[, 1] ~ iris[, 5]) # summary(av) # Df Sum Sq Mean Sq F value Pr(>F) # iris[, 5] 2 63.2 31.6 119 <2e-16 *** # Residuals 147 39.0 0.3 # ---
2009 Nov 18
0
Y axis of 1-D Linear Discriminant Histograms
Hi all. I would like to understand what are the units defined on the y-axis when you plot the one-dimensional predictions (histograms) from lda() (MASS) discriminant function objects? While the helpfile suggests that a histogram is returned by default, the presumably proportion-like values for each group seem to add up to more than 1, and I'm not sure how to interpret the code from ldahist(),
2019 Aug 31
2
inconsistent handling of factor, character, and logical predictors in lm()
Dear Abby, > On Aug 30, 2019, at 8:20 PM, Abby Spurdle <spurdle.a at gmail.com> wrote: > >> I think that it would be better to handle factors, character predictors, and logical predictors consistently. > > "logical predictors" can be regarded as categorical or continuous (i.e. 0 or 1). > And the model matrix should be the same, either way. I think that
2008 Feb 27
2
multiple plots per page using hist and pdf
Hello, I am puzzled by the behavior of hist() when generating multiple plots per page on the pdf device. In the following example two pdf files are generated. The first results in 4 plots on one pdf page as expected. However, the second, which swaps one of the plot() calls for hist(), results in a 4 page pdf with one plot per page. How might I get the histogram with 3 other scatter
2012 Jul 23
1
duplicated() variation that goes both ways to capture all duplicates
Dear all The trouble with the current duplicated() function in is that it can report duplicates while searching fromFirst _or_ fromLast, but not both ways. Often users will want to identify and extract all the copies of the item that has duplicates, not only the duplicates themselves. To take the example from the man page: > data(iris) > iris[duplicated(iris), ] ##duplicates while
2019 Aug 30
3
inconsistent handling of factor, character, and logical predictors in lm()
Dear R-devel list members, I've discovered an inconsistency in how lm() and similar functions handle logical predictors as opposed to factor or character predictors. An "lm" object for a model that includes factor or character predictors includes the levels of a factor or unique values of a character predictor in the $xlevels component of the object, but not the FALSE/TRUE values
2010 Feb 03
1
Calculating subsets "on the fly" with ddply
Hi, [I sent this to the plyr mailing list (late) last night, but it seems to be lost in the moderation queue, so here's a shot to the broadeR community] Apologies in advance for being more verbose than necessary, but I'm not even sure how to ask this question in the context of plyr, so ... here goes. As meaningless as this might be to do with the `iris` data, the spirit of it is what
2003 Sep 09
2
lattice.xyplot: adding grid lines
Hallo, I'd like to add grid lines to a lattice graph having 2 series of Y data. See these 2 examples: data(iris) [1] xyplot(Sepal.Length + Sepal.Width ~ Petal.Length , data = iris, allow.multiple = TRUE, scales = "same",type="l", ) [2] xyplot(Sepal.Length + Sepal.Width ~ Petal.Length , data = iris, allow.multiple = TRUE, scales =
2016 Jul 27
2
Model object, when generated in a function, saves entire environment when saved
Another solution is to only save the parts of the model object that interest you. As long as they don't include the formula (which is what drags along the environment it was created in), you will save space. E.g., tfun2 <- function(subset) { junk <- 1:1e6 list(subset=subset, lm(Sepal.Length ~ Sepal.Width, data=iris, subset=subset)$coef) } saveSize(tfun2(1:4)) #[1] 152 Bill