1. Variables & Basic Types
Learn R variable assignment and basic types (numeric, character, logical) with live, editable R code.
In R, you create a variable with the assignment arrow <- (an equals sign = also works). R has a few core types: numeric, character (text), and logical (TRUE/FALSE). Use class() to check a valueβs type. Edit the code below, then press Run Code.