0

I am trying to use the census_api_key() function in tidycensus, but keep getting an error that it can't be found, nor does it seem like the tidycensus library is being installed properly according to the error messages I am receiving.

Here is what I've done so far:

> install.packages("tidycensus")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/matia/OneDrive/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidycensus_0.11.4.zip'
Content type 'application/zip' length 2683556 bytes (2.6 MB)
downloaded 2.6 MB

> library(tidycensus)
Error: package or namespace load failed for ‘tidycensus’:
 object ‘is_present’ is not exported by 'namespace:lifecycle'
In addition: Warning message:
package ‘tidycensus’ was built under R version 3.6.3 

> census_api_key("my key")
Error in census_api_key("my key") : 
  could not find function "census_api_key"

I've also tried installing the rgdal library, as was suggested for other tidycensus errors, but this hasn't worked for me.

Any suggestions are greatly appreciated.

ddd
  • 1
  • I'd recommend reviewing this thread: https://community.rstudio.com/t/unable-to-install-and-load-packages/84315/7. I'd also recommend updating to R 4.0 if you are able. – kwalkertcu Jan 25 '21 at 19:51
  • Thanks! The function census_api_key() seems to work after updating R! – ddd Jan 25 '21 at 22:55

0 Answers0