Created
September 8, 2022 07:58
-
-
Save DrNickRedfern/db8410547fdeb9c5aa84e5c563fa16ad to your computer and use it in GitHub Desktop.
Another illustration of vectorisation in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create two vectors of equal length | |
X <- c(1, 3, 5, 8) | |
Y <- c(2, 4, 6, 7) | |
# Add the vectors together | |
X + Y | |
[1] 3 7 11 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment