I'm stuck again at an error I don't understand. I have a big data.frame
with multiple stock parameters, such as price earnings ratio etc. Now I want to calculate between columns, i.e.:
MyDataFrame$NewColumn = MyDataFrame$Column1/MyDataFrame$Column2
This worked. However this doesn't work an generates an error:
Index$ValuationScore = 0.3*Index$PE1_Score + 0.2*Index$PE2_Score + 0.1*Index$PE3_Score
The scores are values between 1-6. The first 60 rows of my table don't contain any data only NA
s since I need to calculate an average earlier on looking back 60 periods. The error message I get is:
Warning messages:
1: In Ops.factor(0.3, Index$PE1_Score) : * not meaningful for factors
2: In Ops.factor(0.2, Index$PE2_Score) : * not meaningful for factors
3: In Ops.factor(0.1, Index$PE3_Score) : * not meaningful for factors