R: Dataframe calculations between columns -


i'm stuck again @ error don't understand. have big data.frame multiple stock parameters, such price earnings ratio etc. want calculate between columns, i.e.:

mydataframe$newcolumn = mydataframe$column1/mydataframe$column2 

this worked. doesn't work generates error:

index$valuationscore = 0.3*index$pe1_score + 0.2*index$pe2_score + 0.1*index$pe3_score 

the scores values between 1-6. first 60 rows of table don't contain data nas since need calculate average earlier on looking 60 periods. error message is:

warning messages: 1: in ops.factor(0.3, index$pe1_score) : * not meaningful factors 2: in ops.factor(0.2, index$pe2_score) : * not meaningful factors 3: in ops.factor(0.1, index$pe3_score) : * not meaningful factors 


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -