Skip to content
Back to formatted view

Raw Message

Message-ID: <1349511071156-4645252.post@n4.nabble.com>
Date: 2012-10-06T08:11:11Z
From: fxen3k
Subject: Calculating the mean in one column with empty cells
In-Reply-To: <6E8D8DFDE5FA5D4ABCB8508389D1BF88D4C9BE@SRVEXCHMBX.precheza.cz>

Hi, 

the first command was bringing the numbers into R directly: 
*> testdata <- c(0.2006160108532920, 0.1321167173880490, 0.0563941428921262,
0.0264198664609803, 0.0200581303857603, -0.2971754213679500,
-0.2353086361784190, 0.0667195538296534, 0.1755852636926560)
> mean(testdata)
[1] 0.0161584*

Here I tried to calculate the mean with the same numbers as given above, but
taken from my dataset.
*
> str(dataSet2$ac_bhar_60d_4d_after_ann[1:9])
 num [1:9] 0.2 0.13 0.06 0.03 0.02 -0.3 -0.24 0.07 0.18
> mean(dataSet2$ac_bhar_60d_4d_after_ann[1:9])
[1] 0.01666667
*

It seems that in the second case he calculates the mean with rounded numbers
(0.2 and not 0.20061601085...)
Could it be that R imports only the rounded numbers? 
How can I build a CSV-file with numbers showing all decimal places? Because
I think my current CSV-file only has numbers with 2 decimal places.


Kind Regards,
Felix




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