Back
Close

Computing with Data

elgeish
148.4K views

Scalar Data Types

Scalar types include numeric, integer, logical, string, dates, and factors:

rm(list = ls()) # clears all variables
a = 3.2; b = 3 # double types
b
typeof(b) # function returns type of object
c = as.integer(b) # cast to integer type
c
typeof(c)
c = 3L # alternative to casting: L specifies integer
d = TRUE
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants