similar to: Is formula(data.frame) documented?

Displaying 20 results from an estimated 6000 matches similar to: "Is formula(data.frame) documented?"

2005 Jul 12
4
Calculation of group summaries
I know R has a steep learning curve, but from where I stand the slope looks like a sheer cliff. I'm pawing through the available docs and have come across examples which come close to what I want but are proving difficult for me to modify for my use. Calculating simple group means is fairly straight forward: data(PlantGrowth) attach(PlantGrowth) stack(mean(unstack(PlantGrowth)))
2011 Mar 12
1
Column order in stacking/unstacking
Dear R users, I'm having some problems with the stack() and unstack() functions, and wondered if you could help. I have a large data frame (400 rows x 2000 columns), which I need to reduce to a single column of values (and therefore 800000 rows), so that I can use it in other operations (e.g., generating predictions from a GLM object). However, the problem I'm having can be reproduced
2007 Jul 15
1
Restructuring data
Hi folks, I am new to the list and relatively new to R. I am trying to unstack data "arraywise" and could not find a convenient solution yet. I tried to find a solution for the problem on help archives. I also tried to use the reshape command in R and the reshape package but could not get result. I will illustrate the case below, but the real dataset is quite large so that I would
2000 May 18
0
Control of box and staple width in boxplot()
I''d like to make the following changes (differences are from R1.0.1): boxplot.default() 1c1 < function (x, ..., range = 1.5, width = NULL, varwidth = FALSE, --- > function (x, ..., range = 1.5, width = NULL, varwidth = FALSE, boxwex=0.8, 37c37,38 < bxp(groups, width, varwidth = varwidth, notch = notch, --- > bxp(groups, width, varwidth = varwidth,
2007 Jul 16
5
formula(CO2)
The formula attribute of the builtin CO2 dataset seems a bit strange: > formula(CO2) Plant ~ Type + Treatment + conc + uptake What is one supposed to do with that? Certainly its not suitable for input to lm and none of the examples in ?CO2 use the above.
2009 Nov 15
1
Help with unstack() function
Hi Everyone, I am trying to understand the unstack() function but after struggling for two days, I have given up. More specifically, I am trying the exercises at the end of Chapter 1 of Data Analysis and Graphics Using R by Maindonald and Braun, 2nd ed. Exercise 18 (p. 41) asks to unstack the Rabbit data frame from the MASS package to get a certain data frame that is shown in the exercise.
2004 Mar 19
2
using "unstack" inside my function: that old scope problem again
I've been reading the R mail archives and I've found a lot of messages with this same kind of problem, but I can't understand the answers. Can one of you try to explain this to me? Here's my example. Given a regression model and a variable, I want to use unstack() on the vector of residuals and make some magic with the result. But unstack hates me. PCSE <- function
2010 Oct 18
1
questions on unstack()
Folks, I have the following dataframe: > x <- structure(list(name = c("EU B", "EU B", "EU B", "EU B", "EU B", "EU B", "AU A", "AU A", "AU A", "AU A", "AU A", "AU A"), date = c("2010-10-11", "2010-10-12", "2010-10-13",
2005 Oct 22
0
Getting univariate information from a multivariate data set
A quick question that I've had only partial success in answering. I have a multivariate dataset, and would like to extract some simple univariate information from it grouped by treatments, etc. I am encountering two problems however Note: I am importing my data with my_data <- read.csv("/path/data.csv") 1) Scoping of unstack If I attempt sorted_data <- unstack(response,
2008 Nov 07
0
help with syntax of random formula
Dear R-users Thanks to Jose Pinheiro, Douglas Bates and coworkes for providing R with the nlme package. Could someone help me, please, to specify a correct random formula for a mixed model, that specifies no random effect on a higher level? I have the following dataset of timeseries of respiration measurements (column resp) of biomass including a parameter initial biomass x0. Respiration
2010 Sep 02
1
nlme formula from model specification
Dear R-community, I'm analysing some noise using the nlme-package. I'm writing in order to get my usage of lme verified. In practise, a number of samples have been processed by a machine measuring the same signal at four different channels. I want to model the noise. I have taken the noise (the signal is from position 1 to 3500, and after that there is only noise). My data looks like
2016 Jun 27
1
stack problem
One would normally want the original order that so that one can stack a list, operate on the result and then unstack it back with the unstacked result having the same ordering as the original. LL <- list(z = 1:3, a = list()) # since we can't do s <- stack(LL,. drop = FALSE) do this instead: s <- transform(stack(LL), ind = factor(as.character(ind), levels = names(LL))) unstack(s)
1997 Dec 02
1
R-alpha: NextMethod in 0.50-a4
I am encountering difficulty with NextMethod in 0.50-a4. We created a class of groupedData objects which are data.frames with additional attributes. The most important attribute is a formula describing roles of some of the variables in the experimental design. The class of such objects ends in "groupedData", "data.frame". The print method for the groupedData class simply
2003 Mar 15
1
formula, how to express for transforming the whole model.matrix, data=Orthodont
Hi, R or S+ users, I want to make a simple transformation for the model, but for the whole design matrix. The model is distance ~ age * Sex, where Sex is a factor. So the design matrix may look like the following: (Intercept) age SexFemale age:SexFemale 1 1 8 0 0 2 1 10 0 0 3 1 12 0 0 4
2010 Nov 08
2
Several lattice plots on one page
Dear all, I am trying (!!!) to generate pdfs that have 8 plots on one page: df = data.frame( day = c(1,2,3,4), var1 = c(1,2,3,4), var2 = c(100,200,300,4000), var3 = c(10,20,300,40000), var4 = c(100000,20000,30000,4000), var5 = c(10,20,30,40), var6 = c(0.001,0.002,0.003,0.004), var7 = c(123,223,123,412), var8 = c(213,123,234,435), all = as.factor(c(1,1,1,1)))
2012 Mar 15
1
Accessing variable's name as an attribute?
Sorry - I suspect this is a very basic query. I have a data frame structured "flat" (i.e. separate observations for a given subject ID on separate lines). Using the nlme library I create a groupedData object suitable for further analysis thus: dataset <- groupedData(VARIABLE ~ TIME|ID, data=sfa) The dataset has a large number of VARIABLES of interest so I want to make use of loops
2018 Mar 22
0
How do I include a factor in a groupedData object? Meaning and use of inner and outer parameters
Dear John You are only allowed to have the primary covariate on the left hand side of the vertical bar. Other covariates go in inner or outer. Michael On 22/03/2018 12:59, Sorkin, John wrote: > Windows 10 64-bit, R-Studio, R version 3.4.3 > > > Several questions relating to groupedData: > > (1) I am trying to create a groupedData object that can be used to run an analysis
2008 Jun 04
2
Constructing groupedData objects in nlme - a little problem
Dear R-help, I am trying to create groupedData objects using the nlme library. I'm missing something basic, I know: Here is the first example in ch.1 of Pinheiro & Bates (2000): library(nlme) x2=Rail$travel;x1=Rail$Rail;eg1=data.frame(x1,x2);eg1gd=Rail print(eg1gd) x11();print(plot(eg1gd)) femodel=lm(x2~x1-1,data=eg1gd) print(femodel$coefficients) Result: x12 x15 x11
2018 Mar 22
3
How do I include a factor in a groupedData object? Meaning and use of inner and outer parameters
Windows 10 64-bit, R-Studio, R version 3.4.3 Several questions relating to groupedData: (1) I am trying to create a groupedData object that can be used to run an analysis that I have been able to urn using lmer. When I include the interaction terms in the groupedData opbject I get an error message stating that + is not meaningful for factors. How do I include factors in my model? See code and
2006 Dec 14
1
Reverse order of grouping factor in grouppedData
I created the following groupedData object (nlme library): gd <- groupedData(Conc ~ Time | Subj, order.groups=T, FUN = myf, data=mydata) The idea of the myf function is to reverse the order of the grouping factor Subj (or better, reorder from largest to smallest). In the mydata data set, Subj is an integer that gets converted into a factor in the groupedData object. Does anyone