Linked Questions

Popular Questions

I am not sure if the way I hardcoded this table is the best way of doing it. But anyways, rn I am trying to take the total points column and dividing it by the time needed to get the points per minute then create a new column for that calculation but I can't seem to make it work.

table <- data.frame(list(Question=c("Q1", "Q2", "Q3", "Q4" , "Q5" , "Q6" , "Q7" , "Q8", "Q9"), 
                        Total_Points=c("21","5","10","14","5","5","10","5","5"), Time_needed=c("24","7","15","12","4","3","10","5","6")))
table <- transform(table, Points_per_min = table$Total_Points / table$Time_needed)

Gives me an error "Warning message: In Ops.factor(table$Total_Points, table$Time_needed) : ‘/’ not meaningful for factors"

Thanks so much for help!

Related Questions