Created
March 10, 2018 06:18
-
-
Save rajanand/d51732f93fe75ef37283887d1b37c733 to your computer and use it in GitHub Desktop.
Introduction to R programming
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
x <- 1.5 | |
class(x) | |
#> [1] "numeric" | |
x <- 1 | |
class(x) | |
#> [1] "numeric" | |
#Uppercase L should be suffixed with the number to assign integer datatype. | |
x <- 1L | |
class(x) | |
#> [1] "integer" | |
#Both TRUE and T means logical True. It should be in uppercase as R is a case sensitive. | |
x <- TRUE | |
class(x) | |
#> [1] "logical" | |
x <- T | |
class(x) | |
#> [1] "logical" | |
x <- 'some text' | |
class(x) | |
#> [1] "character" | |
x <- "Isn't it?" | |
class(x) | |
#> [1] "character" | |
x <- 'She said, "It is great"' | |
class(x) | |
#> [1] "character" | |
x <- 'She said, "It\'s great"' | |
class(x) | |
#> [1] "character" | |
x <- "She said, \"Wow\"" | |
class(x) | |
#> [1] "character" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment