read.csv
The utils package, which is automatically loaded in your R session on startup, can import CSV files with the read.csv() function.
In this exercise, you'll be working with swimming_pools.csv; it contains data on swimming pools in Brisbane, Australia (Source: data.gov.au). The file contains the column names in the first row. It uses a comma to separate values within rows.
Type dir() in the console to list the files in your working directory. You'll see that it contains swimming_pools.csv, so you can start straight away.
Este ejercicio forma parte del curso
Importing Data in R (Part 1)
Instrucciones del ejercicio
- Use
read.csv()to import"swimming_pools.csv"as a data frame with the namepools. - Print the structure of
poolsusingstr().
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Import swimming_pools.csv: pools
# Print the structure of pools