Re: Computing new variables — recycling code
Posted: Thu Sep 15, 2022 7:58 am
Thank you. I forgot I was on the stable version, rather than the latest. Am I reading this right, that this solution breaks normal vectorisation in R? I've tried a standard bit of code:
I get an error:
And I can see from your code you have a loop.
I could be coming to the wrong conclusion here, but it almost seems like the operation isn't being completed in a vectorised manner, which seems odd for a vectorised programming language.
Code: Select all
data$FooBar <- data$Subject * 100
Code: Select all
replacement has 0 rows, data has 93
Code: Select all
for
I could be coming to the wrong conclusion here, but it almost seems like the operation isn't being completed in a vectorised manner, which seems odd for a vectorised programming language.