I am working on a data frame with all variables of numeric type
summary.default(pfnew)
- ID 6016315 -none- numeric
- iterator 6016315 -none- numeric
- value 6016315 -none- numeric
- CV 6016315 -none- numeric
I want to create a pivot table grouped by iterator and CV and summarize the count of ID. In essence, I want number of points in the data frame corresponding to a particular set of iterator and CV value. The code I have used is:
Code
install.packages("tidyr")
install.packages("dplyr")
install.packages("vctrs")
library(vctrs)
library(tidyr)
library(dplyr)
allow_lossy_cast(pivot<-pfnew%>%
select(pfnew$iterator,pfnew$CV,pfnew$ID)%>%
summarise(CT=count(pfnew$ID)))
But as discussed in other forums even after using allow_lossy_cast, I am getting the same error message.
Error: Must subset columns with a valid subscript vector. x Can't convert from to due to loss of precision.
How can we resolve this? Or can we do the same job in any other manner?