In order to summarise certain values, I wanted to use the sum function.
However, I get an error when trying to do so:
summarise(sales = sum(sales), orderquantity = sum(orderquantity),
unitprice = mean(unitprice), shippingcost = sum(shippingcost))
Error: Problem with
shippingcost = sum(shippingcost).
x invalid 'type' (character) of argument
After a quick look in my dataset, it seems like the column shippingcost is a character:
However, when trying to change it to a numeric/double only the whole numbers get converted, all the doubles get introduced as NA's:
mutate(shippingcost = as.numeric(shippingcost))
Warning message:Problem with
shippingcost = as.numeric(shippingcost).
i NAs introduced by coercion
Same goes for as.double, any ideas on how to solve this?