[R] Calculating the mean in one column with empty cells

fxen3k f.sehardt at gmail.com
Fri Oct 5 15:14:44 CEST 2012


I'm sorry! 

Now I tried it again with just 10 numbers (just random numbers) and Excel
gives a different output than R.

Here are the numbers I used:

0,2006160108532920
0,1321167173880490
0,0563941428921262
0,0264198664609803
0,0200581303857603
-0,2971754213679500
-0,2353086361784190
0,0667195538296534
0,1755852636926560

And this is the command in R:

> nums <- as.numeric(as.character(dataSet2$ac_bhar_60d_4d_after_ann[2:10]))
> m <- mean(nums, na.rm = T)
> m

The output of R is: 
> print(m, digits= 12)
[1] 0.0166666666667

The output in Excel is:
0,0161584031062386

The numbers are imported correctly. Or does R reduce the imported numbers to
any decimal place? (i don't think so ;-) )

Best Regards,
Felix




--
View this message in context: http://r.789695.n4.nabble.com/Calculating-the-mean-in-one-column-with-empty-cells-tp4645135p4645165.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list