[R] how to find the mean and sd :(

massmatics 2hanl2da at naver.com
Fri Sep 11 16:48:33 CEST 2015

I need help on 4b please :( 
4.) ‘Warpbreaks’ is a built-in dataset in R. Load it using the function
data(warpbreaks). It consists of the number of warp breaks per loom, where a
loom corresponds to a fixed length of yarn. It has three variables namely,
breaks, wool, and tension.

a.)	Write a code (Hint: a logical expression) that extracts the observations
with wool type A and tension level M. Assign it to the object AM.warpbreaks
*(This is done)*

b.) For the ‘AM.warpbreaks’ dataset, compute for the mean and the standard
deviation of the breaks variable for those observations with breaks value
not exceeding 30.


warpbreaks <- data.frame(warpbreaks)

AM.warpbreaks <- subset(warpbreaks, wool=="A" & tension=="M")

*> mean(AM.warpbreaks<=30)


This is what I understood this problem and typed the code as in the last two
lines. However, I wasn't able to run the last two lines while the first 3
lines ran successfully. Can anybody tell me what is the error here? Thanks!

View this message in context: http://r.789695.n4.nabble.com/how-to-find-the-mean-and-sd-tp4712141.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list