How would I count the number of occurences after I filter a dataset in regards to one column (e.g "Variant" column for "A/T") then subsequently filter in another column for words containing a particular word(e.g "SEQ" column for "G[A]C")?
Ive tried the following but received an error:
length(which(mydata$VARIANT =="A/T") & grep(length("G[A]A", mydata$SEQ)))
&, we need logical vectors. So, instead of
grep, it should be
sum(mydata$VARIANT == "A/T" & grepl("G[A]A", mydata$SEQ, fixed = TRUE))