LilahMcC / NarwhalHR

0 stars 1 forks source link

No need for assignment operator #8

Open FlukeAndFeather opened 2 years ago

FlukeAndFeather commented 2 years ago

This works as written because the assignment operator (<-) returns the value being assigned, so read_acc_axis() ends up returning the correct value. But it's kind of confusing to read, since the function should work for any axis, not just x. You can just remove the assignment and it'll work the same while being more readable.

https://github.com/LilahMcC/NarwhalHR/blob/706112e60d29dd9f5ad5e564f8ea65b90017b799/util.R#L10