R uses print() or cat() to output text. R is a language designed for statistical computing and graphics.
R
Learn R for statistical computing and data analysis.
Hello World
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Print "Hello, World!" using the print() function
Click "Run" to execute your code...What symbol starts a comment in R?
SUMMARY
In this section, you learned how to print output to the console. Next, you'll learn how to declare variables and assign values.
Variables and Assignment
R uses <- (preferred) or = for assignment. Variables don’t need type declarations.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Create variables: name, age, is_learning using <-
Click "Run" to execute your code...What is the preferred assignment operator in R?
SUMMARY
In this section, you learned how to declare variables and assign values. Next, you'll learn how to work with different data types.
Arithmetic Operations
R has basic types: numeric, character, logical, integer, and complex. Use class() to check type.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Create variables of different types and print their classes
Click "Run" to execute your code...How do you create an integer in R?
SUMMARY
In this section, you learned how to work with different data types. Next, you'll learn how to work with vectors to store multiple values.
Unlock 10 More Lessons
You've completed the free preview! Upgrade to Pro to access all 12 lessons in this course, plus advanced projects and certificates.
- Vectors
- Conditionals
- For Loops
- While Loops
- Functions
- Lists
- Data Frames
- Apply Functions
- Final Project: Student Performance Analysis