similar to: lattice auto.key drop unused levels

Displaying 20 results from an estimated 2000 matches similar to: "lattice auto.key drop unused levels"

2009 Oct 12
3
xyplot does not find variable in data
When we call a lattice function such as xyplot, to what extent does the "data" designation cause the function to look inside the "data" for variables? In the examples below, the "subset" argument understands that "Variety" is a variable in the data. But the "scales" argument does not understand that "nitro" is a variable in the data.
2009 Jul 26
1
obtain names of variables and data from glm object
Suppose we have some glm object such as: myglm <- glm( y ~ x, data=DAT) Is there an elegant way--or the "right way" within the R way of thinking--to obtain the names of the response variable, the predictor variables, and the dataset, as character strings? For instance, suppose the "right way" was to use the (currently fictitious) functions theresponse(), thepredictors(),
2009 Aug 03
3
session logging
Consider all the text that one sees on the console during an R session. Is there a way, within R, to make all this text--both the "output" and the "messages"--automatically get copied to a single text file, in addition to seeing it on the console? If I remember to save the console to a file at the end of my R session, that does it. But (1) That requires pointing and
2008 Jul 17
2
nested calls, variable scope
Below is an example of a problem I encounter repeatedly when I write functions. A call works at the command line, but it does not work inside a function, even when I have made sure that all required variables are available within the function. The only way I know to solve it is to make the required variable global, which of course is dangerous. What is the elegant or appropriate way to solve
2009 Oct 28
3
variable labels to accompany data.frame
Often it is useful to keep a "codebook" to document the contents of a dataset. (By "dataset" I mean a rectangular structure such as a dataframe.) The codebook has as many rows as the dataset has columns (variables, fields). The columns (fields) of the codebook may include: ? variable name ? type (character, factor, integer, etc) ? variable label
2007 Oct 05
3
Mac GUI and .Renviron
The .Renviron and .First functions do not seem to work the same way on a Mac OS 10.4 as on a Windows XP machine. From working in Windows I am used to creating a new directory for each data analysis project. In the new directory I place First, an .Renviron file consisting of the following text: R_HISTFILE="history.txt" R_HISTSIZE=1000000 Second, an .RData file containing a .First
2009 Aug 05
4
multiple lty on same panel in xyplot
I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types "lty" or colors "col" to distinguish the functions (or groups). In traditional graphics, this seems straightforward: First plot all the data using 'type="n"', and subsequently execute a series of "points"
2013 Dec 02
2
plus/minus +/- in factor; not plotmath not expression
I want to put the "plus or minus" symbol into a character variable, so that this can be turned into a factor and be displayed in the "strip" of a faceted ggplot2 plot. A very nice solution, thanks to Professor Ripley's post of Nov 16, 2008; 3:13pm, visible at http://r.789695.n4.nabble.com/Symbols-to-use-in-text-td874239.html and subsequently
2009 Oct 30
1
How to properly shade the background panels of an xyplot?
Dear R users, this is a follow up of this message http://tolstoy.newcastle.edu.au/R/e6/help/09/05/13897.html I'm reproducing the core of it for convenience. > // > / data(Oats, package = "MEMSS") / > / tp1.oats <- xyplot(yield ~ nitro | Variety + Block, / > / data = Oats, / > / panel = function(x, y, subscripts, ...) { /
2009 Aug 06
1
specify lattice black-and-white theme
Is there a simple way to specify a theme or trellis (lattice) parameters so that, in a multipanel (conditioned) plot, there is no color and in the strips there is no shading? This is the effect achieved on page 124 of Deepayan Sarkar's "Lattice" (figure 7.2). I managed to trick lattice into making a grayscale plot on my interactive display as follows: > graphics.off() >
2009 Aug 07
1
lattice: simultaneously control aspect & outer whitespace
Suppose we wish to achieve the following three aims: (1) Control the aspect ratio of our plot (i.e., tweak this till it looks great) (2) Save the plot as a PDF with zero or minimal white space outside it. (3) Preserve this in code, so that in the future the exact same plot can be reproduced by simply sourcing the code. I can almost achieve (1) and (2) on my MacBook Pro by pointing and clicking,
2004 Jul 27
1
re: help with lattice plot
Dear List, I have been using R to create an xyplot using the panel function within lattice libraries. This plot is based on the data supplied in R named 'Oats'. The graph represents oat yield by nitro level with an overlay of each variety of oats for each nitro level. I have three questions regarding this graph: 1) I cannot seem to specify the type of symbol used by the plot, even though
2010 Jan 19
1
A model-building strategy in mixed-effects modelling
Dear all, Consider a completely randomized block design (let's use data(Oats) irrespoctive of the split-plot design it was arranged in). Look: library(nlme) fit <- lme(yield ~ nitro, Oats, random = ~1|Block, method="ML") fit2 <- lm(yield ~ nitro + Block, Oats) anova(fit, fit2) gives this: Model df AIC BIC logLik Test L.Ratio p-value fit 1 4 624.3245
2017 Oct 10
1
Unbalanced data in split-plot analysis with aov()
Dear all, I'm analysing a split-plot experiment, where there are sometimes one or two values missing. I realized that if the data is slightly unbalanced, the effect of the subplot-treatment will also appear and be tested against the mainplot-error term. I replicated this with the Oats dataset from Yates (1935), contained in the nlme package, where Variety is on mainplot, and nitro on
2006 Oct 09
1
split-plot analysis with lme()
Dear R-help, Why can't lme cope with an incomplete whole plot when analysing a split-plot experiment? For example: R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) > library(nlme) > attach(Oats) > nitro <- ordered(nitro) > fit <- lme(yield ~ Variety*nitro, random=~1|Block/Variety) > anova(fit) numDF denDF F-value
2006 Sep 23
1
variance-covariance structure of random effects in lme
Dear R users, I have a question about the patterned variance-covariance structure for the random effects in linear mixed effect model. I am reading section 4.2.2 of "Mixed-Effects Models in S and S-Plus" by Jose Pinheiro and Douglas Bates. There is an example of defining a compound symmetry variance-covariance structure for the random effects in a split-plot experiment on varieties of
2011 Nov 29
2
Help needed in reproducing a plot
Hello, can anybody tell me how to produce a plot like the one in http://cran.r-project.org/web/packages/lme4/vignettes/Implementation.pdf on page 13, Figure 6? The data is stored in: library(nlme) data(Oats) Cheers -- View this message in context: http://r.789695.n4.nabble.com/Help-needed-in-reproducing-a-plot-tp4119603p4119603.html Sent from the R help mailing list archive at
2007 Apr 23
1
extract from a data frame
hello, I'd like know how to do to extract data from a frame for example how can I do to extract only the data where variety=victory or variety=golden rain thanks. > Oats Block Variety nitro yield 1 I Victory 0.0 111 2 I Victory 0.2 130 3 I Victory 0.4 157 4 I Victory 0.6 174 5 I Golden Rain 0.0 117 6 I Golden Rain
2010 Mar 04
2
fisher.test gives p>1
The purpose of this email is to (1) report an example where fisher.test returns p > 1 (2) ask if there is a reliable way to avoid p>1 with fisher.test. If one has designed one's code to return an error when it finds a "nonsensical" probability, of course a value of p>1 can cause havoc. Example: > junk<-data.frame(score=c(rep(0,14), rep(1,29), rep(2, 16))) >
2011 Jun 02
1
an efficient way to calculate correlation matrix
Dear all, I have a problem. I have m variables each of which has n observations. I want to calculate pairwise correlation among the m variables and store the values in a m x m matrix. It is extremely slow to use nested 'for' loops if m and n are large. Is there any efficient alternative to do this? Many thanks for your suggestions!! Bill