Here is the warning message that appears when I tried installing the apply package: install.packages("apply")Installing package into ?C:/Users/Olufemi/Documents/R/win-library/3.2?(as ?lib? is unspecified)Warning in install.packages : package ?apply? is not available (for R version 3.2.2) Regards On Friday, November 11, 2016 6:37 PM, Ista Zahn <istazahn at gmail.com> wrote: What makes you think " apply' does not work in R 3.2.2"? On Nov 11, 2016 6:24 PM, "Olu Ola via R-help" <r-help at r-project.org> wrote: Hello,I quite understand that apply is doing what it is supposed to do. I actually found that example online. However, "apply" package is not compatible with R 3.2.2 and as a result, I could not use the code. That is why I am asking for an alternative to "apply" that can be used to do the same thing. Regards ? ? On Friday, November 11, 2016 4:08 PM, "MacQueen, Don" <macqueen1 at llnl.gov> wrote: ?Df.1$D looks correct to me. For example, in the third row, 7*2=14 is correct with the NA removed. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 11/11/16, 12:45 PM, "R-help on behalf of Olu Ola via R-help" <r-help-bounces at r-project.org on behalf of r-help at r-project.org> wrote:> Hello,I have a dataset that is similar to the one as follows: > >> Df.1 <- data.frame(A = c(5,4,7,6,8,4),B >>(c(1,5,2,4,9,1)),C=(c(2,3, NA,5,NA,9))) >> Df.1 >? A B? C >1 5 1? 2 >2 4 5? 3 >3 7 2 NA >4 6 4? 5 >5 8 9 NA >6 4 1? 9 >> Df.1$D = apply(Df.1, 1, prod, na.rm=T) >> Df.1$D[1]? 10? 60? 14 120? 72? 36 >> Df.1 >? A B? C? D >1 5 1? 2? 10 >2 4 5? 3? 60 >3 7 2 NA? 14 >4 6 4? 5 120 >5 8 9 NA? 72 >6 4 1? 9? 36I intend to obtain a column D that takes into account na.rm=T >but 'apply' does not work in R 3.2.2 > >A way forward will be greatly appreciated. > >??? [[alternative HTML version deleted]] > >_____________________________ _________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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.? ? ? ? [[alternative HTML version deleted]] ______________________________ ________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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. [[alternative HTML version deleted]]
The "apply" I am familiar with us a FUNCTION in base R, not a contributed package. That is to say, it is always available in R, not something you need to load. -- Sent from my phone. Please excuse my brevity. On November 11, 2016 3:39:53 PM PST, Olu Ola via R-help <r-help at r-project.org> wrote:>Here is the warning message that appears when I tried installing the >apply package: >install.packages("apply")Installing package into >?C:/Users/Olufemi/Documents/R/win-library/3.2?(as ?lib? is >unspecified)Warning in install.packages : package ?apply? is not >available (for R version 3.2.2) >Regards > >On Friday, November 11, 2016 6:37 PM, Ista Zahn <istazahn at gmail.com> >wrote: > > > What makes you think " apply' does not work in R 3.2.2"? >On Nov 11, 2016 6:24 PM, "Olu Ola via R-help" <r-help at r-project.org> >wrote: > >Hello,I quite understand that apply is doing what it is supposed to do. >I actually found that example online. However, "apply" package is not >compatible with R 3.2.2 and as a result, I could not use the code. That >is why I am asking for an alternative to "apply" that can be used to do >the same thing. >Regards > >? ? On Friday, November 11, 2016 4:08 PM, "MacQueen, Don" ><macqueen1 at llnl.gov> wrote: > > >?Df.1$D looks correct to me. For example, in the third row, 7*2=14 is >correct with the NA removed. > >-Don > >-- >Don MacQueen > >Lawrence Livermore National Laboratory >7000 East Ave., L-627 >Livermore, CA 94550 >925-423-1062 > > > > > >On 11/11/16, 12:45 PM, "R-help on behalf of Olu Ola via R-help" ><r-help-bounces at r-project.org on behalf of r-help at r-project.org> wrote: > >> Hello,I have a dataset that is similar to the one as follows: >> >>> Df.1 <- data.frame(A = c(5,4,7,6,8,4),B >>>(c(1,5,2,4,9,1)),C=(c(2,3, NA,5,NA,9))) >>> Df.1 >>? A B? C >>1 5 1? 2 >>2 4 5? 3 >>3 7 2 NA >>4 6 4? 5 >>5 8 9 NA >>6 4 1? 9 >>> Df.1$D = apply(Df.1, 1, prod, na.rm=T) >>> Df.1$D[1]? 10? 60? 14 120? 72? 36 >>> Df.1 >>? A B? C? D >>1 5 1? 2? 10 >>2 4 5? 3? 60 >>3 7 2 NA? 14 >>4 6 4? 5 120 >>5 8 9 NA? 72 >>6 4 1? 9? 36I intend to obtain a column D that takes into account >na.rm=T >>but 'apply' does not work in R 3.2.2 >> >>A way forward will be greatly appreciated. >> >>??? [[alternative HTML version deleted]] >> >>_____________________________ _________________ >>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>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. > > > >? ? ? ? [[alternative HTML version deleted]] > >______________________________ ________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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. > > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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.
Thank you. Regards On Friday, November 11, 2016 6:44 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: The "apply" I am familiar with us a FUNCTION in base R, not a contributed package. That is to say, it is always available in R, not something you need to load. -- Sent from my phone. Please excuse my brevity. On November 11, 2016 3:39:53 PM PST, Olu Ola via R-help <r-help at r-project.org> wrote:>Here is the warning message that appears when I tried installing the >apply package: >install.packages("apply")Installing package into >?C:/Users/Olufemi/Documents/R/win-library/3.2?(as ?lib? is >unspecified)Warning in install.packages : package ?apply? is not >available (for R version 3.2.2) >Regards > >On Friday, November 11, 2016 6:37 PM, Ista Zahn <istazahn at gmail.com> >wrote: > > > What makes you think " apply' does not work in R 3.2.2"? >On Nov 11, 2016 6:24 PM, "Olu Ola via R-help" <r-help at r-project.org> >wrote: > >Hello,I quite understand that apply is doing what it is supposed to do. >I actually found that example online. However, "apply" package is not >compatible with R 3.2.2 and as a result, I could not use the code. That >is why I am asking for an alternative to "apply" that can be used to do >the same thing. >Regards > >? ? On Friday, November 11, 2016 4:08 PM, "MacQueen, Don" ><macqueen1 at llnl.gov> wrote: > > >?Df.1$D looks correct to me. For example, in the third row, 7*2=14 is >correct with the NA removed. > >-Don > >-- >Don MacQueen > >Lawrence Livermore National Laboratory >7000 East Ave., L-627 >Livermore, CA 94550 >925-423-1062 > > > > > >On 11/11/16, 12:45 PM, "R-help on behalf of Olu Ola via R-help" ><r-help-bounces at r-project.org on behalf of r-help at r-project.org> wrote: > >> Hello,I have a dataset that is similar to the one as follows: >> >>> Df.1 <- data.frame(A = c(5,4,7,6,8,4),B >>>(c(1,5,2,4,9,1)),C=(c(2,3, NA,5,NA,9))) >>> Df.1 >>? A B? C >>1 5 1? 2 >>2 4 5? 3 >>3 7 2 NA >>4 6 4? 5 >>5 8 9 NA >>6 4 1? 9 >>> Df.1$D = apply(Df.1, 1, prod, na.rm=T) >>> Df.1$D[1]? 10? 60? 14 120? 72? 36 >>> Df.1 >>? A B? C? D >>1 5 1? 2? 10 >>2 4 5? 3? 60 >>3 7 2 NA? 14 >>4 6 4? 5 120 >>5 8 9 NA? 72 >>6 4 1? 9? 36I intend to obtain a column D that takes into account >na.rm=T >>but 'apply' does not work in R 3.2.2 >> >>A way forward will be greatly appreciated. >> >>??? [[alternative HTML version deleted]] >> >>_____________________________ _________________ >>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>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. > > > >? ? ? ? [[alternative HTML version deleted]] > >______________________________ ________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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. > > >? >??? [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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.[[alternative HTML version deleted]]
Wow, you are quite confused! Have you gone through any basic R tutorials (there are many good ones on the web), as it sure looks like you have not and therefore have almost no idea how to use R. If that is the case, it is unlikely that this list (or R!) is going to be much use to you. Anyway, apply() is a standard *built-in function* in base R. There is NO apply package. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Nov 11, 2016 at 3:39 PM, Olu Ola via R-help <r-help at r-project.org> wrote:> Here is the warning message that appears when I tried installing the apply package: > install.packages("apply")Installing package into ?C:/Users/Olufemi/Documents/R/win-library/3.2?(as ?lib? is unspecified)Warning in install.packages : package ?apply? is not available (for R version 3.2.2) > Regards > > On Friday, November 11, 2016 6:37 PM, Ista Zahn <istazahn at gmail.com> wrote: > > > What makes you think " apply' does not work in R 3.2.2"? > On Nov 11, 2016 6:24 PM, "Olu Ola via R-help" <r-help at r-project.org> wrote: > > Hello,I quite understand that apply is doing what it is supposed to do. I actually found that example online. However, "apply" package is not compatible with R 3.2.2 and as a result, I could not use the code. That is why I am asking for an alternative to "apply" that can be used to do the same thing. > Regards > > On Friday, November 11, 2016 4:08 PM, "MacQueen, Don" <macqueen1 at llnl.gov> wrote: > > > Df.1$D looks correct to me. For example, in the third row, 7*2=14 is > correct with the NA removed. > > -Don > > -- > Don MacQueen > > Lawrence Livermore National Laboratory > 7000 East Ave., L-627 > Livermore, CA 94550 > 925-423-1062 > > > > > > On 11/11/16, 12:45 PM, "R-help on behalf of Olu Ola via R-help" > <r-help-bounces at r-project.org on behalf of r-help at r-project.org> wrote: > >> Hello,I have a dataset that is similar to the one as follows: >> >>> Df.1 <- data.frame(A = c(5,4,7,6,8,4),B >>>(c(1,5,2,4,9,1)),C=(c(2,3, NA,5,NA,9))) >>> Df.1 >> A B C >>1 5 1 2 >>2 4 5 3 >>3 7 2 NA >>4 6 4 5 >>5 8 9 NA >>6 4 1 9 >>> Df.1$D = apply(Df.1, 1, prod, na.rm=T) >>> Df.1$D[1] 10 60 14 120 72 36 >>> Df.1 >> A B C D >>1 5 1 2 10 >>2 4 5 3 60 >>3 7 2 NA 14 >>4 6 4 5 120 >>5 8 9 NA 72 >>6 4 1 9 36I intend to obtain a column D that takes into account na.rm=T >>but 'apply' does not work in R 3.2.2 >> >>A way forward will be greatly appreciated. >> >> [[alternative HTML version deleted]] >> >>_____________________________ _________________ >>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>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. > > > > [[alternative HTML version deleted]] > > ______________________________ ________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.