I have a dataset with three columns. The first column is type, second column is area and third column is worth. I want to write a logical vector such that the type =1 , area = 3 and worth = 6. I was able to create the data frame using subset but I couldn’t create a logical vector.
hello <- read.csv("type.csv")
hello1 <- subset(hello, type==1 & area ==3 & worth ==6)
There are many NA values in worth column.
The data set is https://www.dropbox.com/s/gjjwmnr8uxmy18y/type.csv
Thanks.
Jdbaba
So the question remains answered:
Remember, you can just use it as:
as well. However, when you have more statements to check for, a
withcomes in handy as it allows you to check without typinghello$every time.