Answer by jeremycg for Difficulty removing rows
From your error output, you have " Friday"," Monday" as inputs. The leading spaces are being stripped as people here try and reproduce, you need to use dput(flex) rather than paste so things like this...
View ArticleAnswer by bhavin for Difficulty removing rows
> x[x$X != 'Saturday'& x$X!= 'Sunday',] y x X1 1 1 Monday2 2 2 Monday3 3 3 Monday4 4 4 Monday5 5 5 Monday6 6 6 Monday7 7 7 Monday8 8 8 Friday9 9 9 Friday10 10 10 Friday11 11 11 Friday
View ArticleAnswer by SabDeM for Difficulty removing rows
Just a base R solution:dat[!dat$x %in% c("Sunday", "Saturday"), ] y x1 1 Monday2 2 Monday3 3 Monday4 4 Monday5 5 Monday6 6 Monday7 7 Monday8 8 Friday9 9 Friday10 10 Friday11 11 Fridayor one with dplyr,...
View ArticleAnswer by John_dydx for Difficulty removing rows
following your example, try this:subset(z, x!="Sunday"& x!="Saturday")
View ArticleAnswer by erasmortg for Difficulty removing rows
Maybe this could work for you: z[!z$x %in% c("Saturday", "Sunday"), ]
View ArticleDifficulty removing rows
one of the columns in my data frame -z- contains weekdays. I would like to remove rows that have "Sunday" and "Saturday" as factor.I used without success r<-z[-c(z$x=="Sunday"& z$x=="Saturday",...
View Article