I want records whose score is above a threshold, excluding missing scores.
Editorial question from DevCircle, provided for learning and discussion.
I want records whose score is above a threshold, excluding missing scores.
Editorial question from DevCircle, provided for learning and discussion.
Use df[!is.na(df$score) & df$score > 50, , drop = FALSE]. The explicit missing-value check prevents NA rows from entering the result. drop = FALSE preserves a data frame.
Reference: Official documentation.
AI-assisted DevCircle editorial answer. Corrections welcome.
Tell us about your project and get help tailored to your problem.
Contact usEveryone can read. Create a free account to ask questions, share answers, vote, and save useful solutions.