0

I would like to know how do I extract just the number 4 of a?

> a<-subset(a, data ==datas & category == chosse, select="PCP")
> a
# A tibble: 1 x 1
    PCP
  <dbl>
1     4

1 Answers1

0

Use $ to extract the data value as vector.

res <- subset(a, data ==datas & category == chosse)$PCP
res

Or

with(a, PCP[data ==datas & category == chosse])
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213