U-Shift / Transport-Demand-Modelling

Supporting materials for the Transport Demand Modeling course, lectured by Prof. Filipe Moura.
MIT License
23 stars 15 forks source link

Draft for chapter 0 - how to install R #2

Closed temospena closed 3 years ago

temospena commented 3 years ago

How to install R and RStudio

Installation

You should install R before installing RStudio.

Install R

  1. Go to world wide CRAN mirror: https://cloud.r-project.org/
  2. Select you OS
  3. select base (if you want to install R for the first time)
  4. Download and run

Install RStudio

This is a wrapper for a friendly usage of R.

  1. Go to RStudio download website: https://rstudio.com/products/rstudio/download/
  2. Select the Free RStudio Desktop version
  3. Download and run

Install basic packages

Open RStudio (not R !).

If you type sessionInfo() at the console, it will show you the packages you have with your installation.

You can install packages by the menu on the Packages tab image

Try to install readxl(to deal with MS Excel files). It will install also some dependent packages.

You may also type in the console the packages or group of packages you'd like to install. Try to install these three packages with the console:

Type

install.packages(c("tidyverse","devtools","RColorBrewer"))

Even if you want only one package, the command is in plural :)

Load packages

simply by calling them

library(tidyverse)
librar(readxl)
...

When you restart R (Ctrl + Shift + F10) you'll need to load packages again.

The R dashboard

R script

You can click here at the upper left icon, and select R Script image Or Ctrl + Shift + F Or in the console, type file.edit("startup.R)

Start by typing the aim of that script, commented with a cardinall (#) You can comment/uncomment any line by selectin it and press Ctrl + Shift + C

Save the script .

Working directory

Flavors

See r.rosafelix.bike for some R tips to use in Transport Demand Modeling ! (em português)

######################

R markdown

install pandoc (https://pandoc.org/installing.html)

Filezilla

To make your outputs online at your IST server space

Donwload at: https://filezilla-project.org/download.php?type=client

temospena commented 3 years ago

Passado para um Rmd.