Use is.numeric(list) on the list to see if it is a list of numbers or if it is list of characters. If it is a list of characters (which could be the case if you read it in using read.csv or the like) and it makes sense to convert to numeric, then do something like:
list<-as.numeric(list) -Roy On Aug 30, 2013, at 5:18 AM, agnes69 <fes...@gredeg.cnrs.fr> wrote: > When I try to apply mean to a list, I get the answer : > > argument is not numeric or logical: returning NA > > Could you help me? > > (I am a very beginner) > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/mean-tp4674999.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. ********************** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ********************** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center 1352 Lighthouse Avenue Pacific Grove, CA 93950-2097 e-mail: roy.mendelss...@noaa.gov (Note new e-mail address) voice: (831)-648-9029 fax: (831)-648-8440 www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected" "the arc of the moral universe is long, but it bends toward justice" -MLK Jr. ______________________________________________ R-help@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.