So I have a data set from a package and I want to create a new data frame, with only Cities with crime rates above 30% for one column.
The data set has a column, Crime, which has the crime rates for cities. The values are in decimal form.
df2 <- Cities[,"Crime" > .30]
But it's not returning only the cities with crime rates above 0.30, it's returning all of them. I'm not sure why this is since I've specified > 0.30 in the code? I just spent some time looking around for help on subsetting and creating data frames and none of them were helpful with this type of problem, they were only general subsetting ones where you're selecting the whole column.
I feel like I'm very close and I've tried other things but I'm getting frustrated.