Tutorials
References
Exercises
Videos
Menu
Log in
Create Website
Get Certified
Upgrade
HTML
CSS
JAVASCRIPT
SQL
PYTHON
JAVA
PHP
BOOTSTRAP
HOW TO
W3.CSS
C
C++
C#
REACT
R
JQUERY
DJANGO
TYPESCRIPT
NODEJS
MYSQL
Dark mode
Dark code
×
Tutorials
HTML and CSS
Learn HTML
Learn CSS
Learn RWD
Learn Bootstrap
Learn W3.CSS
Learn Colors
Learn Icons
Learn Graphics
Learn SVG
Learn Canvas
Learn How To
Learn Sass
Data Analytics
Learn AI
Learn Machine Learning
Learn Data Science
Learn NumPy
Learn Pandas
Learn SciPy
Learn Matplotlib
Learn Statistics
Learn Excel
XML Tutorials
Learn XML
Learn XML AJAX
Learn XML DOM
Learn XML DTD
Learn XML Schema
Learn XSLT
Learn XPath
Learn XQuery
JavaScript
Learn JavaScript
Learn jQuery
Learn React
Learn AngularJS
Learn JSON
Learn AJAX
Learn AppML
Learn W3.JS
Programming
Learn Python
Learn Java
Learn C
Learn C++
Learn C#
Learn R
Learn Kotlin
Learn Go
Learn Django
Learn TypeScript
Server Side
Learn SQL
Learn MySQL
Learn PHP
Learn ASP
Learn Node.js
Learn Raspberry Pi
Learn Git
Learn MongoDB
Learn AWS Cloud
Web Building
Create a Website
NEW
Where To Start
Web Templates
Web Statistics
Web Certificates
Web Development
Code Editor
Test Your Typing Speed
Play a Code Game
Cyber Security
Accessibility
Join our Newsletter
Data Analytics
Learn AI
Learn Machine Learning
Learn Data Science
Learn NumPy
Learn Pandas
Learn SciPy
Learn Matplotlib
Learn Statistics
Learn Excel
Learn Google Sheets
XML Tutorials
Learn XML
Learn XML AJAX
Learn XML DOM
Learn XML DTD
Learn XML Schema
Learn XSLT
Learn XPath
Learn XQuery
×
References
HTML
HTML Tag Reference
HTML Browser Support
HTML Event Reference
HTML Color Reference
HTML Attribute Reference
HTML Canvas Reference
HTML SVG Reference
Google Maps Reference
CSS
CSS Reference
CSS Browser Support
CSS Selector Reference
Bootstrap 3 Reference
Bootstrap 4 Reference
W3.CSS Reference
Icon Reference
Sass Reference
JavaScript
JavaScript Reference
HTML DOM Reference
jQuery Reference
AngularJS Reference
AppML Reference
W3.JS Reference
Programming
Python Reference
Java Reference
Server Side
SQL Reference
MySQL Reference
PHP Reference
ASP Reference
XML
XML DOM Reference
XML Http Reference
XSLT Reference
XML Schema Reference
Character Sets
HTML Character Sets
HTML ASCII
HTML ANSI
HTML Windows-1252
HTML ISO-8859-1
HTML Symbols
HTML UTF-8
×
Exercises and Quizzes
Exercises
HTML Exercises
CSS Exercises
JavaScript Exercises
Python Exercises
SQL Exercises
PHP Exercises
Java Exercises
C Exercises
C++ Exercises
C# Exercises
jQuery Exercises
React.js Exercises
MySQL Exercises
Bootstrap 5 Exercises
Bootstrap 4 Exercises
Bootstrap 3 Exercises
NumPy Exercises
Pandas Exercises
SciPy Exercises
TypeScript Exercises
Excel Exercises
R Exercises
Git Exercises
Kotlin Exercises
Go Exercises
MongoDB Exercises
Quizzes
HTML Quiz
CSS Quiz
JavaScript Quiz
Python Quiz
SQL Quiz
PHP Quiz
Java Quiz
C Quiz
C++ Quiz
C# Quiz
jQuery Quiz
React.js Quiz
MySQL Quiz
Bootstrap 5 Quiz
Bootstrap 4 Quiz
Bootstrap 3 Quiz
NumPy Quiz
Pandas Quiz
SciPy Quiz
TypeScript Quiz
XML Quiz
R Quiz
Git Quiz
Kotlin Quiz
Cyber Security Quiz
Accessibility Quiz
Courses
HTML Course
CSS Course
JavaScript Course
Front End Course
Python Course
SQL Course
PHP Course
Java Course
C++ Course
C# Course
jQuery Course
React.js Course
Bootstrap 4 Course
Bootstrap 3 Course
NumPy Course
Pandas Course
TypeScript Course
XML Course
R Course
Data Analytics Course
Cyber Security Course
Accessibility Course
Certificates
HTML Certificate
CSS Certificate
JavaScript Certificate
Front End Certificate
Python Certificate
SQL Certificate
PHP Certificate
Java Certificate
C++ Certificate
C# Certificate
jQuery Certificate
React.js Certificate
MySQL Certificate
Bootstrap 5 Certificate
Bootstrap 4 Certificate
Bootstrap 3 Certificate
TypeScript Certificate
XML Certificate
Excel Certificate
Data Science Certificate
Cyber Security Certificate
Accessibility Certificate
×
Tutorials
References
Exercises
Get Certified
Upgrade
Spaces
Videos
Shop
R
Tutorial
R HOME
R Intro
R Get Started
R Syntax
Syntax
Print
R Comments
R Variables
R Data Types
R Numbers
R Math
R Strings
R Booleans
R Operators
R If...Else
R While Loop
R For Loop
R Functions
Functions
Global Variables
R
Data Structures
R Vectors
R Lists
R Matrices
R Arrays
R Data Frames
R Factors
R
Graphics
R Plot
R Line
R Scatterplot
R Pie Charts
R Bars
R
Statistics
R Statistics Intro
R Data Set
R Max and Min
R Mean Median Mode
R Mean
R Median
R Mode
R Percentiles
R Examples
R Examples
R Compiler
R Exercises
R Quiz
R Certificate
R
Examples
❮ Previous
Next ❯
R Syntax
Output some text
Output numbers
Do a simple calculation
Output some text with the print() function
Syntax Explained
R Comments
Single-line comment before a line of code
Single-line comment at the end of a line of code
Multi-line comment
Comments Explained
R Variables
Creating two variables
Combine both text and a variable
Add a variable to another variable
Display the sum of two variables by using the + operator
Assign the same value to multiple variables in one line
Variables Explained
R Data Types
Changing the type of a variable after it has been set
Using the class() function to check the data type of different variables
Data Types Explained
R Numbers
Creating a numeric data type
Creating an integer
Creating a complex number
Converting from one type to another
Numbers Explained
R Math
Add numbers
Subtract numbers
Find the lowest or highest number in a set
Find the square root of a number
Return the absolute (positive) value of a number
Round a number upwards and downwards to its nearest integer
Math Explained
R Strings
Creating a string literal
Assigning a string to a variable
Find the number of characters in a string
Check a string for a character or a sequence of characters
Combine/concatenate two strings
Using an escape character to output a word in a string
Strings Explained
R Booleans
Compare different values
Compare variables
Booleans Explained
R Operators
Addition operator
Subtraction operator
Multiplication operator
Division operator
Exponent operator
Modulus operator
Integer Division operator
Equal operator
Not equal operator
Greater than operator
Less than operator
Greater than or equal to operator
Less than or equal to operator
Operators Explained
R If...Else
If statement
Else if statement
If else statement
Nested if statements
The AND operator (&)
The OR operator (&)
If...Else Explained
R While Loop
While loop
While loop with a break
While loop with the next statement
If..else combined with a while loop
While Loop Explained
R For Loop
Using a for loop to iterate over a sequence
Using a for loop to print every item in a list
Using a for loop to print the number of dices
If..else combined with a for loop
A nested for loop
For Loop Explained
R Functions
Call a function
Function arguments
Default parameter value
Let a function return a value
Nested function
Recursion
Functions Explained
R Global Variables
Create a variable outside of a function and use it inside the function
Create a variable inside of a function with the same name as the global variable
Create a global variable inside a function
Global Variables Explained
R Vectors
Create a vector of strings
Create a vector of numbers
Create a vector with numerical values in a sequence
Find the length of a vector
Sort a vector
Access a vector
Change a vector item
Vectors Explained
R Lists
Create a list
Access lists
Change item value
List length
Lists Explained
R Matrices
Create a matrix
Access matrix items
Matrix length
Matrices Explained
R Arrays
Create arrays
Access matrix items
Array length
Arrays Explained
R Data Frames
Create a data frame
Access data frame items
Data Frames length
Data Frames Explained
R Factors
Create a factor
Access factors
Factor length
Factors Explained
❮ Previous
Next ❯
COLOR PICKER
Get certified
by completing
a
course today!
w
3
s
c
h
o
o
l
s
C
E
R
T
I
F
I
E
D
.
2
0
2
2
Get started