R is a programming language that is a little different in syntax then your typical mainstream languages like Java or C#. In this post we will go over how to create variables in R.
Let's create some variables about a user:
To create a variable in we use the <- key for example if you want to assign a value to variable firstName, you would write firstName <- "John" or "John" -> firstName
If you type in the firstName in the console you will "John" as the value
To get the type of the variable you can use the class(firstName)
As you can see the variable firstName has the type character
Now let say you created a new variable call zipCode and you want to convert to a string. You can do that with the "as" method first lets create the zipCode variable with the statement zipCode <- 90210
Now let's see what the type of zipCode is by using the class method class(zipCode)
Let's convert the zipCode variable to the character type by using the "as" function like the following
zipCode <- as.character(zipCode)
Liên hệ Aivivu, đặt vé máy bay tham khảo
ReplyDeletegia ve may bay di my
đăng ký từ mỹ về việt nam
vé máy bay từ đức về việt nam giá rẻ
vé máy bay từ việt nam sang nga bao nhiêu
vé máy bay từ anh về việt nam
mua vé máy bay giá rẻ từ pháp về việt nam
chi phi ve may bay cho chuyen gia nuoc ngoai