data_different_tech_count <- data_different_tech %>%
group_by(tech) %>%
summarise(count(tech))
now this gives me a data.frame as an output but I am unable to save the file. When I try to change the colnames, it shows me:
colnames(data1)[c(1,2)]<- c("tech","count")
Error in
colnames<-
(*tmp*
, value = c("tech", "count")) : 'names' attribute [2] must be the same length as the vector [1]
When I am using
colnames(data_different_count_tech)
It says that I have only one column. When I am using the
summary(data_different_count_tech)
it shows two columns.
When I am trying to write this file to my directory it returns the following error.
write.csv(file=data_different_tech_count,"tech.csv")
Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, : length of 'dimnames' [2] not equal to array extent
summarise (count = n ())
. But you haven't named the variable you've created, and I'm not sure how dplyr will handle that. – Benjamin