[R] pull stat out of summary
pdalgd at gmail.com
Sat Apr 1 16:10:59 CEST 2017
> On 01 Apr 2017, at 01:54 , Sarah Goslee <sarah.goslee at gmail.com> wrote:
> The short answer is that hold isn't a list-like object, and $ only
> works with list-like objects (lists and data frames, mainly).
> You can get the full explanation (VERY full), at
> or any of its aliases, like
...and the intermediate answer is: hold["Mean"]
> On Fri, Mar 31, 2017 at 7:11 PM, Evan Cooch <evan.cooch at gmail.com> wrote:
>> Continuing my learning curve after 25_ years with using SAS. Want to pull
>> the "Mean" forom the summary of something...
>> test <- rnorm(1000,1.5,1.25)
>> hold <- summary(test)
>>  "Min." "1st Qu." "Median" "Mean" "3rd Qu." "Max."
>> OK, so "Mean" is in there.
>> So, is there a short form answer for why hold$Mean throws an error, and
>> hold["Mean"} returns the mean (as desired)?
>> Silly question I know, but gotta start somewhere...
> Sarah Goslee
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Office: A 4.23
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help