Hi everyone,
I have been working with the ccf function recently, and in particular to
do my calculations I have been using na.action = na.pass. I noticed
that the help documentation mentions that with this option the computed
estimate may not be a valid autocorrelation sequence and was
If you want to remove the N, then you can work with the indices:
x
[1] NA B NA B B NA N A B B A NA A N N N
A B B A
# if you want the indices of the non-N, then
(indx - which(is.na(x) | x != N))
[1] 1 2 3 4 5 6 8 9 10 11 12 13 17 18 19 20
x[indx]
[1] NA B NA B B NA A B B A NA
Not sure exactly what you are trying to do since you did not provide
commented, minimal, self-contained, reproducible code. Let me take a
guess in that you also have to test for NAs:
x - sample(c(N, A, B, NA), 20, TRUE)
x
[1] A A B NA N NA NA B B N N N B A NA A
B NA A NA
x != N
[1]
Hi All,
I have a data frame which has columns comprised mainly of NAs. I know
there are functions na.pass and na.omit etc which can be used in these
situations however I can't them to work in this case. I have a function
which returns the data according to some rule i.e. removal of N in this
I have a data frame. It has lots of patient information, their age, their
gender, etc etc. I need to keep all this information whilst selecting
relevant rows. So, in the example of code I provided I want to remove all
those patients who have entry N in the column with.Wcode. The dimension of
5 matches
Mail list logo