0

I a am quiet new to R. I want to select rows that have at least four consecutive values. I started to do this but I'm kind of stocked now and don't know what to do. Does any one know how to do ? Thank you !

library(openxlsx)

DATA <- openxlsx::read.xlsx("DATAA.xlsx")
DATA$nb_na <- rowSums(is.na(DATA[,7:26]))
DATA4 <- subset(DATA, nb_na<=16)
r2evans
  • 141,215
  • 6
  • 77
  • 149
nasizi
  • 1
  • 2
    Please show a small reproducible example and expected output base do nt hat – akrun Mar 04 '21 at 16:36
  • Welcome to SO, nasizi! Please make this question *reproducible*. This includes sample *unambiguous* data (e.g., `data.frame(x=...,y=...)` or the output from `dput(head(x))`) and intended output given that input. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. Thanks! – r2evans Mar 04 '21 at 16:40
  • (Since your question is not about reading data from an external xlsx file, I suggest you don't need to include the first two lines of your code here, just a sample of the data.) – r2evans Mar 04 '21 at 16:41

0 Answers0