R provides powerful functions. Apply function is one of them. It keeps you from writing boring loops(while and for). For insance:
# create a matrix of 10 rows x 2 columns
(1:10, 11:20), nrow = 10, ncol = 2)
# divide all values by apply
Thanks for nsaunders
In R as you know, when it have been written: summary(lm(x~y)), the command gives a lot of different ‘mystic’ values. I have found a good manual for interpreting the result. It is here
Besides, do not forget lm command is relevant with “regression” model. If you want to compute the simple correlation between two parameter use cor(x,y) command.
If you do not have any idea about difference, here is good article for you
A bottle filling machine is set to fill bottles with soft drink to a volume of 500 ml. The actual volume is known to follow a normal distribution. The manufacturer believes the machine is under-filling bottles. A sample of 20 bottles is taken and the volume of liquid inside is measured.
Good and sweat guide here