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

Setting a cache directory

Spatial data from the US Census Bureau can get very big - sometimes hundreds of megabytes in size. By default, tigris functions download data from the US Census Bureau's website - but this can get tiresome if downloading the same large datasets over and over. To resolve this, tigris includes an option to cache downloaded data on a user's computer for future use, meaning that files only have to be downloaded from the Census website once. In this exercise, you'll get acquainted with the caching functionality in tigris.

Bu egzersiz

Analyzing US Census Data in R

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

Egzersiz talimatları

  • Use a simulated version of the tigris_cache_dir() function to set a hypothetical cache directory.
  • Set the tigris_use_cache option to TRUE to tell tigris to cache shapefiles.
  • Use getOption() to check that you've modified the cache option correctly.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Set the cache directory
___("Your preferred cache directory path would go here")

# Set the tigris_use_cache option
options(___ = ___)

# Check to see that you've modified the option correctly
___("tigris_use_cache")
Kodu Düzenle ve Çalıştır