R filtering out a subset

前端 未结 6 1350
误落风尘
误落风尘 2021-01-29 13:30

I have a data.frame A and a data.frame B which contains a subset of A

How can I create a data.frame C which is data.frame A with data.frame B excluded? Thanks for your h

6条回答
  •  温柔的废话
    2021-01-29 14:33

    If this B data set is truly a nested version of the first data set there has to be indexing that created this data set to begin with. IMHO we shouldn't be discussing the differences between the data sets but negating the original indexing that created the B data set to begin with. Here's an example of what I mean:

    A <- mtcars
    B <- mtcars[mtcars$cyl==6, ]
    C <- mtcars[mtcars$cyl!=6, ]
    

提交回复
热议问题