massmatics
2015-Sep-18 11:18 UTC
[R] How do I use the proper r code to find the value of intersection (What horsepower(hp) does the “Valiant” have?)
I am studying for a quiz and I have some problems while reviewing. I used the command data(mtcars) and I used *intersect(mtcarsValiant,mtcarshp)* but the value I received was *numeric(0) *What is the proper r code I must use to get the correct value? (The value I should get is 105) Thanks! -- View this message in context: http://r.789695.n4.nabble.com/How-do-I-use-the-proper-r-code-to-find-the-value-of-intersection-What-horsepower-hp-does-the-Valiant-tp4712428.html Sent from the R help mailing list archive at Nabble.com.
François Morneau
2015-Sep-18 12:17 UTC
[R] How do I use the proper r code to find the value of intersection (What horsepower(hp) does the “Valiant” have?)
Hello (Who?), Perhaps should you try to do your homework, look at "An Introduction to R" for example and read the help pages :> ?intersect # is clearly not what your are looking for > ?'[' # seems betterand you would have find that :> mtcars["Valiant", "hp"] # is one way to get what you are looking for.You should also have a look at :> library(fortunes) > fortune(122)Regards, Fran?ois Le 18/09/2015 13:18, massmatics a ?crit :> I am studying for a quiz and I have some problems while reviewing. I used the > command data(mtcars) and I used *intersect(mtcarsValiant,mtcarshp)* but the > value I received was *numeric(0) *What is the proper r code I must use to > get the correct value? (The value I should get is 105) Thanks! > > > > -- > View this message in context: http://r.789695.n4.nabble.com/How-do-I-use-the-proper-r-code-to-find-the-value-of-intersection-What-horsepower-hp-does-the-Valiant-tp4712428.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
massmatics
2015-Sep-18 13:47 UTC
[R] How do I use the proper r code to find the value of intersection (What horsepower(hp) does the “Valiant” have?)
Wow thank you so much! -- View this message in context: http://r.789695.n4.nabble.com/How-do-I-use-the-proper-r-code-to-find-the-value-of-intersection-What-horsepower-hp-does-the-Valiant-tp4712428p4712438.html Sent from the R help mailing list archive at Nabble.com.