Skip to Main Content
SQL Server 2017 Developer???s Guide
book

SQL Server 2017 Developer???s Guide

by Dejan Sarka, Miloš Radivojević, William Durkin
March 2018
Intermediate to advanced content levelIntermediate to advanced
816 pages
19h 35m
English
Packt Publishing
Content preview from SQL Server 2017 Developer???s Guide

R language basics

You can start investigating R by writing simple expressions that include literals and operators. Here are some examples:

1 + 1;
2 + 3 * 4;
3 ^ 3;
sqrt(81);
pi;

This code evaluates three mathematical expressions first using the basic operators. Check the results and note that R, as expected, evaluates the expressions using operator precedence as we know from mathematics. Then it calls the sqrt() function to calculate the square root of 81. Finally, the code checks the value of the base package built-in constant for the number pi (π). R has some built-in constants. Check them by searching help for them with ??"constants".

It is easy to generate sequences. The following code shows some examples:

rep(1,10); 3:7; seq(3,7); seq(5,17,by=3); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL Server 2016 Developer's Guide

SQL Server 2016 Developer's Guide

Miloš Radivojević, Dejan Sarka, William Durkin
Mastering SQL Server 2017

Mastering SQL Server 2017

Milos Radivojevic, Dejan Sarka, William Durkin, Christian Cote, Matija Lah

Publisher Resources

ISBN: 9781788476195Supplemental Content