[R] Calculating group means

Bert Gunter gunter.berton at gene.com
Mon Jan 27 15:33:31 CET 2014


That is not a small reproducible example. There's no r code. Please
read the posting guide to learn how to post to r-help.

-- Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch




On Mon, Jan 27, 2014 at 6:29 AM, Anoop Kumarkm <anoop.kumarkm at tcs.com> wrote:
> Hi Bert,
>
> Thanks for the reply.
>
> Here is the snippet from R shell running on top of a kerberos secured hadoop
> cluster
>
> =============
>
>> Sys.setenv(HADOOP_CMD="/usr/bin/hadoop")
>> library(rhdfs)
> Loading required package: rJava
> HADOOP_CMD=/usr/bin/hadoop
> Be sure to run hdfs.init()
>> hdfs.init()
>> hdfs.ls("/")
> 14/01/27 06:26:48 ERROR security.UserGroupInformation:
> PriviledgedActionException as:root (auth:KERBEROS)
> cause:javax.security.sasl.SaslException: GSS initiate failed [Caused by
> GSSException: No valid credentials provided (Mechanism level: Failed to find
> any Kerberos tgt)]
> 14/01/27 06:26:48 WARN ipc.Client: Exception encountered while connecting to
> the server : javax.security.sasl.SaslException: GSS initiate failed [Caused
> by GSSException: No valid credentials provided (Mechanism level: Failed to
> find any Kerberos tgt)]
> 14/01/27 06:26:48 ERROR security.UserGroupInformation:
> PriviledgedActionException as:root (auth:KERBEROS)
> cause:java.io.IOException: javax.security.sasl.SaslException: GSS initiate
> failed [Caused by GSSException: No valid credentials provided (Mechanism
> level: Failed to find any Kerberos tgt)]
> Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  :
>   java.io.IOException: Failed on local exception: java.io.IOException:
> javax.security.sasl.SaslException: GSS initiate failed [Caused by
> GSSException: No valid credentials provided (Mechanism level: Failed to find
> any Kerberos tgt)]; Host Details : local host is: "host1.com"; destination
> host is: "host.com":8020;
>
> =================
>
> Thanks & Regards
> Anoop Kumar K M
> TCS Digital Enterprise-Analytics And BigData
> Tata Consultancy Services Limited
> TCS Centre-SEZ
> Infopark Special Economic Zone, Kakkanad, Kusumagiri Post
> Kochi - 682030,Kerala
> India
> Ph:- +91 4846187171
> Buzz:- 6187171
> Mailto: anoop.kumarkm at tcs.com
> Website: http://www.tcs.com
> ____________________________________________
> Experience certainty. IT Services
> Business Solutions
> Consulting
> ____________________________________________
>
>
> -----r-help-bounces at r-project.org wrote: -----
> To: "Laura Bethan Thomas [lbt1]" <lbt1 at aber.ac.uk>, "r-help at r-project.org"
> <r-help at r-project.org>
> From: Bert Gunter
> Sent by: r-help-bounces at r-project.org
> Date: 01/27/2014 07:54PM
> Subject: Re: [R] Calculating group means
>
> 1. Please cc anything but personal remarks to the list, not to me.
> That will assure better answers.
>
> 2. Your query is too vague for me to be sure -- a small reproducible
> example of what you'd like would be very helpful here -- but I am
> guessing that you want the ?ave function instead of by().
>
> Cheers,
> Bert
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
> (650) 467-7374
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
> H. Gilbert Welch
>
>
>
>
> On Mon, Jan 27, 2014 at 4:27 AM, Laura Bethan Thomas [lbt1]
> <lbt1 at aber.ac.uk> wrote:
>> Hi Bert,
>>
>> Thank you very much for your help with my R issue. The code you suggested
>> has worked- do you know of a way I can extract the averages this gives me
>> into a data frame or table?
>>
>> Many thanks for tour help,
>>
>> Laura
>>
>> On 24 Dec 2013, at 07:28, Bert Gunter <gunter.berton at gene.com> wrote:
>>
>>> Jim:
>>>
>>> Did you forget about with() ?
>>>
>>> Instead of:
>>>
>>> by(lbtdat$latency,list(lbtdat$subject,
>>>  lbtdat$condition,lbtdat$state),mean)
>>>
>>> ##do
>>>
>>> with(ibtdat,by(latency,list(subject,condition,state),mean))
>>>
>>>
>>> Bert Gunter
>>>
>>> "Data is not information. Information is not knowledge. And knowledge
>>> is certainly not wisdom."
>>> H. Gilbert Welch
>>>
>>>
>>>
>>>
>>> On Mon, Dec 23, 2013 at 6:37 PM, Jim Lemon <jim at bitwrit.com.au> wrote:
>>>> On 12/23/2013 11:31 PM, Laura Bethan Thomas [lbt1] wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> Sorry for what I imagine is quite a basic question. I have been trying
>>>>>> to
>>>>>> do is create latency averages for each state (1-8) for each
>>>>>> participant
>>>>>> (n=13) in each condition (1-10). I'm not sure what function I would
>>>>>> need, or
>>>>>> what the most efficient ay of calculating this would be. If you have
>>>>>> any
>>>>>> help with that I would be very grateful.
>>>>>>
>>>>>> structure(list(subject = c(1L, 1L, 1L, 1L, 1L, 1L), conditionNo =
>>>>>> c(1L,
>>>>>> 1L, 1L, 1L, 1L, 1L), state = c(5L, 8L, 7L, 8L, 1L, 7L), latency =
>>>>>> c(869L,
>>>>>> 864L, 1004L, 801L, 611L, 679L)), .Names = c("subject", "conditionNo",
>>>>>> "state", "latency"), row.names = 3:8, class = "data.frame")
>>>>>>
>>>> Hi Laura,
>>>> You can do it like this:
>>>>
>>>> # make up enough data to do the calculation
>>>> lbtdat<-data.frame(subject=rep(1:13,each=160),
>>>> condition=rep(rep(rep(1:10,each=8),2),13),
>>>> state=rep(rep(1:8,20),13),
>>>> latency=sample(600:1100,2080,TRUE))
>>>> by(lbtdat$latency,list(lbtdat$subject,
>>>> lbtdat$condition,lbtdat$state),mean)
>>>>
>>>> but you are going to get a rather long list of means.
>>>>
>>>> Jim
>>>>
>>>> ______________________________________________
>>>> R-help at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide
>>>> http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you




More information about the R-help mailing list