0% found this document useful (0 votes)
10 views

Intro to Quarto

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Intro to Quarto

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Intro to R, RStudio and Quarto

Environment, (Import Dataset:


From Excel file)
(Workspace: variables, objects)
Script (.R) or Quarto (.qmd) History, Connections
(Where you write the
explanations and code to
use the statistical software)

Files, (with the files of the project)


Plots, (all the plots made will be there)
Packages, (to Install packages and see
the ones used)
Console: where results
Help, (to ask for help in functions)
of code chunks appear
Viewer
Some comments about R
• R is an object-oriented software. Your dataset will be an object and the results you get will be also an object. Ctrl+L cleans the
• R differentiates between Capital letters and small letters. Be careful when writing names of variables. Console window
• Avoid leaving spaces in the names of the projects, names of the variables
• <- is the assignation operator (like an arrow from right to left) We use it like this: name_object <- value_to_assign Script. Everything after
• To open a data file fron Excel. Import Dataset, From Excel File. Browse: choose the data Excel file where it is stored. Click on Import a # symbol is a
comment
Write with QMD (Quarto Markdown) (as a text processor inside a statistics software, easy to use) (file with extension .qmd)
Quarto project. File  New Project  New Directory  Quarto project
Quarto document. File  New File  Quarto document

Yaml (At the beginning of the file)


• Specifies metadata in the final file created (title, format, author, date…)
• Between these symbols ---
• Very important: spaces and indented lines
You can generate different types of document if you specify for format: html, pdf, docx, epub, pptx…
format: html format: pdf format: docx
If format is not specified, by default is html. To create a pdf file To create a docx file
To create a html file, to see in a web browser But you have to install tinytex package:
install.packages("tinytex") From it, you can generate the pdf
It can be seen different (as plain text) if you and then run the following 2 lines the 1st time you install tinytex in a pc:
don’t have the css files related. library(tinytex)
install_tinytex()

Code chunks (pieces with R code, identified by {r}). Insert code chunks (green button with a C and a + sign) Keyboard shortcut: Alt + Ctrl + I (Alt + Control + i letter)

• R ignores spaces in the code, but you can put them to read better.
• Data types. 1) Numeric: real numbers (1,2, 3.5) in blue;
2) Character: text characters, always between “__” (“Yes”, “woman”), in green;
3) Logical: TRUE or FALSE (also T or F), in blue
• Functions (in black), arguments inside the function (in black)
• Options or values given to arguments (in blue) Result appear after [1]
• Basic operators: + (addition), - (subtraction), * (multiplication), / (division), ^ (to
the power of)

You might also like