Introductie & read.csv

Introductie tot het importeren van data in R

Filip Schouwenaars

Instructor, DataCamp

Data importeren in R

ch_1_1_slides.005.png

Introductie tot het importeren van data in R

Data importeren in R

ch_1_1_slides.006.png

Introductie tot het importeren van data in R

5 types

Introductie tot het importeren van data in R

5 types

ch_1_1_slides.008.png

Introductie tot het importeren van data in R

5 types

ch_1_1_slides.009.png

Introductie tot het importeren van data in R

5 types

ch_1_1_slides.010.png

Introductie tot het importeren van data in R

5 types

ch_1_1_slides.011.png

Introductie tot het importeren van data in R

5 types

ch_1_1_slides.012.png

Introductie tot het importeren van data in R

5 types

ch_1_1_slides.013.png

Introductie tot het importeren van data in R

Platte bestanden

states.csv

state,capital,pop_mill,area_sqm
South Dakota,Pierre,0.853,77116
New York,Albany,19.746,54555
Oregon,Salem,3.970,98381
Vermont,Montpelier,0.627,9616
Hawaii,Honolulu,1.420,10931
wanted_df

         state    capital pop_mill area_sqm
1 South Dakota     Pierre    0.853    77116
2     New York     Albany   19.746    54555
3       Oregon      Salem    3.970    98381
4      Vermont Montpelier    0.627     9616
5       Hawaii   Honolulu    1.420    10931
Introductie tot het importeren van data in R

utils - read.csv

  • Standaard geladen bij het starten van R

    read.csv("states.csv")
    
  • Wat als het bestand in de map datasets van de thuismap staat (~)?

path <- file.path("~", "datasets", "states.csv")

path
"~/datasets/states.csv"
read.csv(path)
Introductie tot het importeren van data in R

Laten we oefenen!

Introductie tot het importeren van data in R

Preparing Video For Download...