Import a local file
In this part of the chapter you'll learn how to import .xls files using the gdata package. Similar to the readxl package, you can import single Excel sheets from Excel sheets to start your analysis in R.
You'll be working with the urbanpop.xls dataset, the .xls version of the Excel file you've been working with before. It's available in your current working directory.
Este ejercicio forma parte del curso
Importing Data in R (Part 1)
Instrucciones del ejercicio
- Load the
gdatapackage withlibrary().gdataand Perl are already installed on DataCamp's Servers. - Import the second sheet, named
"1967-1974", of"urbanpop.xls"withread.xls(). Store the resulting data frame asurban_pop. - Print the first 11 observations of
urban_popwithhead().
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Load the gdata package
# Import the second sheet of urbanpop.xls: urban_pop
# Print the first 11 observations using head()