similar to: An exercise in the use of 'substitute'

Displaying 20 results from an estimated 10000 matches similar to: "An exercise in the use of 'substitute'"

2002 Jun 26
1
Bug? (PR#1710)
Hi, I tried to do a multiple linear model from the example dataset Formaldehyde. However, the function lm() did not estimate the coefficient of the term carb^2. The same problem occurred with the (nlme)dataset Pixel with both function lme() and lm(). I am using the windows version of R 1.5.1 Lauri Mehtatalo The Formaldehyde example: > data(Formaldehyde) >
2002 Dec 13
2
how to get Residual Standard Error
Hi, I use lm or loess to make smoothing. After smoothing I need "Residual Standard Error" in my script. Could you please tell me how can I get this information? Thanks,
2000 Dec 30
0
editor in Windows doesn't like a data frame with row names (PR#797)
The editor in R version 1.2.0 returns an error after editing a data frame that has row names. This is on a Windows 2000 system, but I've encountered the same problem under Windows 95. Here's a simple example: ------------------------------------------------------------------------------------ R : Copyright 2000, The R Development Core Team Version 1.2.0 (2000-12-15) R is free
2000 Dec 31
0
editor in Windows doesn't like a data frame with row names (PR#798)
On Sun, 31 Dec 2000 jfox@mcmaster.ca wrote: > The editor in R version 1.2.0 returns an error after editing a data frame > that has row names. This is on a Windows 2000 system, but I've encountered > the same problem under Windows 95. Here's a simple example: Actually, that's not where the error is. If you use traceback() you will see it is in edit.data.frame. That tries
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
2007 Dec 06
2
simple problems
Hello R users, I have been looking through Help files and Nabble list for the answers for these simple questions, but it seems to be fruitless. 1- in a data frame with two columns, x and y, how do I get the corresponding value of x to, let's say, the minimum value of the y column (min (data$y)) ? 2- how do I solve a simple equation? Considering the equation y= exp(-x)^12, I would like to find
2004 Nov 03
4
Newbie question: plotting regression models
Greetings. Is there any way to get R to take a regression model object and draw a plot of the regression function? How about overlaying that plot over a scatterplot of the actual data? Thanks in advance for any help anyone can provide. Aaron ----- Aaron Solomon?? (??ben Saul Joseph??) ??Adelman E-mail??: ??adelmaas at musc.edu Web site??: ??http??://??people.musc.edu??/??~adelmaas??/??
1998 Feb 24
2
Representation of data in libraries
At present the example data sets in R libraries are to be given as expressions that can be read directly into R. For example, the acid.R file in the main library looks like acid <- data.frame( carb = c(0.1, 0.3, 0.5, 0.6, 0.7, 0.9), optden = c(0.086, 0.269, 0.446, 0.538, 0.626, 0.782), row.names = paste(1:6)) This is great when you have only a few observations. I have one example data
2003 Dec 11
1
packaging standards for rda files?
Dear everybody: We used the fine foreign library to bring in an SPSS dataset that was about 9 megabytes and I can squeeze it into a much smaller R object using compression with save(ndat, file="NatAnnES2000.rda", compress=T). I can use load() to get the "ndat" dataframe back, that's all good as far as I can see. If I put that file in the data subdirectory, then the
2013 Jun 25
1
F statistic in add1.lm vs add1.glm
Should the F statistic be the same when using add1() on models created by lm and glm(family=gaussian)? They are in the single-degree-of-freedom case but not in the multiple-degree-of-freedom case. MASS:addterm shows the same discrepancy. It looks like the deviance (==residual sum of squares) gets divided by the number of degrees of freedom for the term twice in add1.glm. Using anova() on the
2012 Nov 04
1
Apply same linear model to subset of dataframe
I have applied the same linear model to several different subsets of a dataset. I recently read that in R, code should never be repeated. I feel my code as it currently stands has a lot of repetition, which could be condensed into fewer lines. I will use the mtcars dataset to replicate what I have done. My question is: how can I use fewer lines of code (for example using a for loop, a function or
2020 Jun 17
2
subset data.frame at C level
Hi, Hope you are well. I was wondering if there is a function at C level that is equivalent to mtcars$carb or .subset2(mtcars, "carb"). If I have the index of the column then the answer would be VECTOR_ELT(df, asInteger(idx)) but I was wondering if there is a way to do it directly from the name of the column without having to loop over columns names to find the index? Thank you Best
2016 Apr 14
0
Bug in by() function which works for some FUN argument and does not work for others
I think you are not using the best function for what your intentions are. Try: > by(data=mtcars, INDICES=list(as.factor(mtcars$am)), FUN=colMeans) : 0 mpg cyl disp hp drat wt qsec vs 17.1473684 6.9473684 290.3789474 160.2631579 3.2863158 3.7688947 18.1831579 0.3684211 am gear carb 0.0000000
2010 Nov 30
3
pca analysis: extract rotated scores?
Dear all I'm unable to find an example of extracting the rotated scores of a principal components analysis. I can do this easily for the un-rotated version. data(mtcars) .PC <- princomp(~am+carb+cyl+disp+drat+gear+hp+mpg, cor=TRUE, data=mtcars) unclass(loadings(.PC)) # component loadings summary(.PC) # proportions of variance mtcars$PC1 <- .PC$scores[,1] # extract un-rotated scores of
2020 Oct 18
1
Resultado de la consola como un tibble
Hola, Bueno, puedes hacer el cálculo de una forma mucho más compacta y rápida. Esta forma es especialmente recomendable cuando tienes muchas columnas y muchas filas. > library(data.table) > myDT <- as.data.table(mtcars) > myDTlong <- melt(myDT, measure.vars=1:ncol(myDT)) > myDTlong[ , list(p_value = shapiro.test(value)$p.value, v_stat = shapiro.test(value)$statistic) , by
2007 May 12
2
Implicit vs explicit printing and the call stack
Hi everyone, I've run into a bit of strange problem with implicit vs explicit printing and the call stack. I've included an example at the bottom of this email. The basic problem is that I have an S3 object with a print method. When the object is implicitly printed (ie. typed directly into the console) the function arguments in the call stack are exploded out to their actual values,
2016 Apr 15
4
Bug in by() function which works for some FUN argument and does not work for others
Dear All, Thanks for your help. However, I would like to draw your attention to the following: Actually, I was replicating the Example 2.3, using the dataset "brainsize.txt" given in Section 2.3.3 ("Summarize by group") at page 55, of a famous book "R by Example" written by "Jim Albert and Maria Rizzo" published in Springers (2012) in a Use R! Series. The
2016 Apr 15
0
Bug in by() function which works for some FUN argument and does not work for others
> On Apr 15, 2016, at 1:16 AM, Akhilesh Singh <akhileshsingh.igkv at gmail.com> wrote: > > Dear All, > > Thanks for your help. However, I would like to draw your attention to the > following: > > Actually, I was replicating the Example 2.3, using the dataset > "brainsize.txt" given in Section 2.3.3 ("Summarize by group") at page 55, > of a
2016 Apr 14
4
Bug in by() function which works for some FUN argument and does not work for others
Dear Sirs, I am Professor at Indira Gandhi Krishi Vishwavidyalaya, Raipur, Chhattisgarh, India. While taking classes, I found the *by() *function producing following error when I use FUN=mean or median and some other functions, however, FUN=summary works. Given below is the output of the example I used on a built-in dataset "mtcars", along with error message reproduced herewith: >
2005 Feb 02
4
(no subject)
can you recommend a good manual for R that starts with a data set and gives demonstrations on what can be done using R? I downloadedR Langauage definition and An introduction to R but haven't found them overly useful. I'd really like to be able to follow some tutorials using a dataset or many datasets. The datasets I have available on R are Data sets in package 'datasets':