I have two sets(a and b). I try to use %in% to choose all values in a, that are also in b.
The set a is read from text file using the following code:
a <- read.table("filename.txt")
names(a) <- c("time","A")
the output from this table read is like this
a <- data.frame(time = seq(0,20,0.2), A = seq(1,20,0.0333))
The set b is shown as the following format,
b <- data.frame(x = seq(1,20,0.2))
To achieve the match purpose, I need to use %in% like this
a <- subset(a, time %in% b$x)
Now an issue come out, some values in the a set are also in the b set.However, the return subset does not contain these value because they are considered no-match one.
I do not understand why this happen and how to fix this issue. Would you please give some suggestions to fix this problem?
Thanks
Hong