BaşlayınÜcretsiz Başlayın

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 (view), containing urban population data throughout time. The Excel file is available in your current working directory.

Bu egzersiz

Introduction to Importing Data in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Load the XLConnect package using library(); it is already installed on DataCamp's servers.
  • Use loadWorkbook() to build a connection to the "urbanpop.xlsx" file in R. Call the workbook my_book.
  • Print out the class of my_book using the class() function. What does this tell you?

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Load the XLConnect package
library(___)

# Build connection to urbanpop.xlsx: my_book
my_book <- ___

# Print out the class of my_book
___
Kodu Düzenle ve Çalıştır