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
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
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])