Created
June 22, 2016 04:41
-
-
Save korakot/2b681871bdd7059249686ab8342e100a to your computer and use it in GitHub Desktop.
Vector in R #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
remain <- c(11,12,11,13) | |
# name the elements | |
suits <- c("spades", "hearts", "diamonds", "clubs") | |
names(remain) <- suits | |
# shortcut | |
remain <- c(spades=11, hearts=12, diamonds=11, clubs=13) | |
str(remain) # see detail | |
# a normal var is a vector of length 1 | |
apples = 5 | |
is.vector(apples) # TRUE | |
length(apples) # 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment