Cloud Stack Ninja

I have two data frames and I'm asked to calculate the sub-total before discount. I tried to multiply Prices column with Quantities column from the first data frame and then add Delivery Fee from second data frame with R code

Order <- transform(
  Sub_Total_Before_Discount=((raw$Prices * raw$Quantities) + Order$Delivery_Fee)

and it returns error

Error in raw$Prices * raw$Quantities : non-numeric argument to binary operator

I'm still new to R so please help me if there's any way to calculate this. Thank you so much.

1st data frame

2nd data frame

Read more here:

Content Attribution

This content was originally published by newt335 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: