What is this word on top of my character vector in R and how do I get rid of it -
i want isolate value in summary of data frame, wrote:
> summary(pf$mobile_likes > 0)[2] false "35056"
the response command character vector, , can convert integer
> typeof(summary(pf$mobile_likes > 0)[2]) [1] "character" > strtoi(summary(pf$mobile_likes > 0)[2]) [1] 35056
still, don't understand why false
header shows on top. it, , how can isolate character vector it?
your summary vector, , you're seeing there element name.
you can wrap call in unname
rid of names.
> x <- 1:5 > (summ <- summary(x > 2)[2:3]) # false true # "2" "3" > names(summ) # [1] "false" "true" > unname(summ) # [1] "2" "3"
Comments
Post a Comment