Hello,
2. x[!x$A %in% y$B, ]
1.
An Introduction to R, file R-into.pdf in your docs folder.
http://www.cookbook-r.com/Basics/Indexing_into_a_data_structure/
Hope this helps,
Rui Barradas
Às 15:06 de 25/10/2018, Knut Krueger escreveu:
Hi Bert,
another question for indexing
1. is there a good manual for indexing
2. is it possible to get !%in%
f.e
x =data.frame("A"=c(1:5),"C"=c("A","B","C","D","E"))
y =data.frame("B"=c(1,3,5))
test = x[x$A %in% y$B,]
test = x[x$A %in% y$B,]
test
A C
1 1 A
3 3 C
5 5 E
means: the result where I am looking for is:
test
A C
2 2 B
4 4 D
no problem with a loop but in a short way I do not find a solution
Kind Regards Knut
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.