Connect to a workbook
When working with XLConnect, the first step will be to load a workbook in your R session with loadWorkbook(); this function will build a "bridge" between your Excel file and your R session.
In this and the following exercises, you will continue to work with urbanpop.xlsx, containing urban population data throughout time. The Excel file is available in your current working directory.
Este ejercicio forma parte del curso
Importing Data in R (Part 1)
Instrucciones del ejercicio
- Load the
XLConnectpackage usinglibrary(); it is already installed on DataCamp's servers. - Use
loadWorkbook()to build a connection to the"urbanpop.xlsx"file in R. Call the workbookmy_book. - Print out the class of
my_book. What does this tell you?
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# urbanpop.xlsx is available in your working directory
# Load the XLConnect package
# Build connection to urbanpop.xlsx: my_book
# Print out the class of my_book