rowSums and pivot_wider issues


I'm trying to calculate the total amount and average amount of volume left in some tubes in a large data set. I thought this would be a simple task of using rowSums and then a rowMeans function and creating a few more columns, however I keep getting the same errors and I can't seem to work around it.

My code is essentially:


pivot_wider(practice,names_from = tube,values_from = microlitres)->practice


I get an error saying "x must be numeric", but when I try


I then get an error saying "list object cannot be coerced into double". I feel like I've tried everything, unlisting things, making it a matrix, using the mutate function... I know whatever it is will probably be a simple solution, but any help or advice would be greatly appreciated.


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.