Closed jdanowski closed 4 years ago
This tutorial is years old and those functions are deprecated and should not be used.
Once the package is installed you should be able to run this code successfully.
library(gdeltr2)
library(tidyverse)
ft_v2_api(terms = c('"Corona Virus"'))
ft_trending_terms()
ft_terms_sentiment(terms = c('"Corona Virus"'))
How do I install the package? When I run this:
devtools::install_github("hafen/trelliscopejs") devtools::install_github("abresler/gdeltr2")
I get these errors:
devtools::install_github("hafen/trelliscopejs") Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘processx’ devtools::install_github("abresler/gdeltr2") Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘processx’
Searching I find that this may involve Rtools not being installed. Nevertheless, I downloaded rtool40 and installed it. Thanks for helping me get gdeltr2 installed properly!
On Tue, Jul 14, 2020 at 8:22 AM Alex Bresler notifications@github.com wrote:
This tutorial is years old and those functions are deprecated and should not be used.
Once the package is installed you should be able to run this code successfully.
library(gdeltr2) library(tidyverse)
ft_v2_api(terms = c('"Corona Virus"')) ft_trending_terms() ft_terms_sentiment(terms = c('"Corona Virus"'))
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/abresler/gdeltr2/issues/6#issuecomment-658176299, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANBIBMO5JGJJQTFELVVZELR3RL23ANCNFSM4OZCBL6A .
I am not sure what operating system you are using but it says you need processx
try installing that and if it tells you packages are missing install the package the warning says is missing.
I attempted to run: learning_to_program_with_gdeltr2.r and encountered errors.
R version 4.0.1 (2020-06-06) -- "See Things Now" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/dplyr_1.0.0.zip' Content type 'application/zip' length 1302941 bytes (1.2 MB) downloaded 1.2 MB
package ‘dplyr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)
There is a binary version available but the source version is later: binary source needs_compilation rlang 0.4.6 0.4.7 TRUE
Binaries will be installed trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_0.4.6.zip' Content type 'application/zip' length 1117248 bytes (1.1 MB) downloaded 1.1 MB
package ‘rlang’ successfully unpacked and MD5 sums checked Warning in install.packages : cannot remove prior installation of package ‘rlang’ Warning in install.packages : problem copying C:\Users\james\Desktop\Documents\R\win-library\4.0\00LOCK\rlang\libs\x64\rlang.dll to C:\Users\james\Desktop\Documents\R\win-library\4.0\rlang\libs\x64\rlang.dll: Permission denied Warning in install.packages : restored ‘rlang’
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyr_1.1.0.zip' Content type 'application/zip' length 1514102 bytes (1.4 MB) downloaded 1.4 MB
package ‘tidyr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/purrr_0.3.4.zip' Content type 'application/zip' length 429884 bytes (419 KB) downloaded 419 KB
package ‘purrr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/stringr_1.4.0.zip' Content type 'application/zip' length 216792 bytes (211 KB) downloaded 211 KB
package ‘stringr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/lubridate_1.7.9.zip' Content type 'application/zip' length 1748364 bytes (1.7 MB) downloaded 1.7 MB
package ‘lubridate’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/readr_1.3.1.zip' Content type 'application/zip' length 1716096 bytes (1.6 MB) downloaded 1.6 MB
package ‘readr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyr_1.1.0.zip' Content type 'application/zip' length 1514102 bytes (1.4 MB) downloaded 1.4 MB
package ‘tidyr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggplot2_3.3.2.zip' Content type 'application/zip' length 4067278 bytes (3.9 MB) downloaded 3.9 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/highcharter_0.7.0.zip' Content type 'application/zip' length 3001981 bytes (2.9 MB) downloaded 2.9 MB
package ‘highcharter’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip' Content type 'application/zip' length 440111 bytes (429 KB) downloaded 429 KB
package ‘tidyverse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)
There is a binary version available but the source version is later: binary source needs_compilation tibble 3.0.2 3.0.3 TRUE
Binaries will be installed trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tibble_3.0.2.zip' Content type 'application/zip' length 413689 bytes (403 KB) downloaded 403 KB
package ‘tibble’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/hrbrthemes_0.8.0.zip' Content type 'application/zip' length 2326933 bytes (2.2 MB) downloaded 2.2 MB
package ‘hrbrthemes’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggthemes_4.2.0.zip' Content type 'application/zip' length 440978 bytes (430 KB) downloaded 430 KB
package ‘ggthemes’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages 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/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/jsonlite_1.7.0.zip' Content type 'application/zip' length 1170880 bytes (1.1 MB) downloaded 1.1 MB
package ‘jsonlite’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\james\AppData\Local\Temp\RtmpoRW9yz\downloaded_packages [[1]] NULL
[[2]] NULL
[[3]] NULL
[[4]] NULL
[[5]] NULL
[[6]] NULL
[[7]] NULL
[[8]] NULL
[[9]] NULL
[[10]] NULL
[[11]] NULL
[[12]] NULL
[[13]] NULL
[[14]] NULL
[[15]] NULL
[[16]] NULL
1: All
2: CRAN packages only
3: None
4: rlang (0.4.6 -> 0.4.7) [CRAN] 5: pillar (1.4.4 -> 1.4.6) [CRAN] 6: pkgbuild (1.0.8 -> 1.1.0) [CRAN] 7: backports (1.1.7 -> 1.1.8) [CRAN] 8: processx (3.4.2 -> 3.4.3) [CRAN] 9: xfun (0.14 -> 0.15 ) [CRAN] 10: tibble (3.0.2 -> 3.0.3) [CRAN] 11: Rcpp (1.0.4.6 -> 1.0.5) [CRAN] 12: isoband (0.2.1 -> 0.2.2) [CRAN]
Enter one or more numbers, or an empty line to skip updates: devtools::install_github("abresler/gdeltr2") Enter one or more numbers, or an empty line to skip updates: 1 rlang (0.4.6 -> 0.4.7 ) [CRAN] pillar (1.4.4 -> 1.4.6 ) [CRAN] pkgbuild (1.0.8 -> 1.1.0 ) [CRAN] backports (1.1.7 -> 1.1.8 ) [CRAN] processx (3.4.2 -> 3.4.3 ) [CRAN] xfun (0.14 -> 0.15 ) [CRAN] tibble (3.0.2 -> 3.0.3 ) [CRAN] Rcpp (1.0.4.6 -> 1.0.5 ) [CRAN] isoband (0.2.1 -> 0.2.2 ) [CRAN] checkmate (NA -> 2.0.0 ) [CRAN] moments (NA -> 0.14 ) [CRAN] diptest (NA -> 0.75-7) [CRAN] mclust (NA -> 5.4.6 ) [CRAN] Installing 13 packages: rlang, pillar, pkgbuild, backports, processx, xfun, tibble, Rcpp, isoband, checkmate, moments, diptest, mclust Installing packages into ‘C:/Users/james/Desktop/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)
There are binary versions available but the source versions are later: binary source needs_compilation rlang 0.4.6 0.4.7 TRUE pillar 1.4.4 1.4.6 FALSE pkgbuild 1.0.8 1.1.0 FALSE backports 1.1.7 1.1.8 TRUE tibble 3.0.2 3.0.3 TRUE
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/processx_3.4.3.zip' Content type 'application/zip' length 1147666 bytes (1.1 MB) downloaded 1.1 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/xfun_0.15.zip' Content type 'application/zip' length 229776 bytes (224 KB) downloaded 224 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/Rcpp_1.0.5.zip' Content type 'application/zip' length 3265784 bytes (3.1 MB) downloaded 3.1 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/isoband_0.2.2.zip' Content type 'application/zip' length 3408747 bytes (3.3 MB) downloaded 3.3 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/checkmate_2.0.0.zip' Content type 'application/zip' length 699101 bytes (682 KB) downloaded 682 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/moments_0.14.zip' Content type 'application/zip' length 56099 bytes (54 KB) downloaded 54 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/diptest_0.75-7.zip' Content type 'application/zip' length 364327 bytes (355 KB) downloaded 355 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/mclust_5.4.6.zip' Content type 'application/zip' length 4630961 bytes (4.4 MB) downloaded 4.4 MB
package ‘processx’ successfully unpacked and MD5 sums checked Error: Failed to install 'trelliscopejs' from GitHub: (converted from warning) cannot remove prior installation of package ‘processx’
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
The following objects are masked from ‘package:base’:
Warning message: package ‘dplyr’ was built under R version 4.0.2