2 Getting to know R data types
This chapter covers
- Types of data you will likely encounter
- How R stores data using types
- How to assign values to variables
In any programming language, data is stored by the computer in memory using binary values. A binary value has only two possible states, and we can think of these as TRUE
and FALSE
, or more commonly, as 1
and 0
. In computer memory, these represent the presence or absence of an electrical charge, so they are also ON
and OFF
.
We may see a 42
on the screen, but that’s thanks to the computer translating what it has stored into what we expect to see. This can be extremely useful (better than seeing 00000000 00000000 00000000 00101010
) but also somewhat dangerous, as we’ll discuss later.
Get Beyond Spreadsheets with R now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.