Reputation: 1735
I have a trivial question that I can't seem to figure out. I have a data matrix of dimension 20000 X 1. I have another logical variable called logVal of the length 20000. The logical value pertains to whether the matrix elements falls below certain value or not. If it does, the logVal is TRUE, or else it's FALSE. I want to make a boxplot to whether the logVal behaves differently for the matrix. But i can't seem to figure out how to do this. Can somebody please help?
Thanks in advance
Upvotes: 0
Views: 923
Reputation: 5856
something like this?
df <- data.frame(v <- runif(20000, 0, 1))
df$g <- ifelse(df$v < 0.5, T, F)
with(df, boxplot(v~g))
Upvotes: 1