seancarmody / ngramr

R package to query the Google Ngram Viewer
Other
48 stars 9 forks source link

"Error parsing ngram data, please contact package maintainer." #42

Closed jwburton closed 1 year ago

jwburton commented 1 year ago

Hi there. I've encountered the following error when making a standard query.

> library(ngramr)
> 
> ng  <- ngrami("human capital", year_start = 1800, smoothing = 0)
Error parsing ngram data, please contact package maintainer.
Here's the original error message:
subscript out of bounds
Error occurred in the following code:
[[stringr::str_split(grep("drawD3Chart", years, value = TRUE), ",")1

Any idea how to resolve this?

Thanks for maintaining such a nice package!

seancarmody commented 1 year ago

Thanks for letting me know. I will investigate. Google does sometimes change the website code which can break the package

seancarmody commented 1 year ago

Yes, the format of the Google page has changed again. I have fixed it. It will take a while to get it up on CRAN. In the meantime you can try the version directly from here on GitHub:

library(devtools)
install_github("seancarmody/ngramr")
library(ngramr)
jwburton commented 1 year ago

Working smoothly now. Thank you!

seancarmody commented 1 year ago

Glad to hear it. Note that the fixed version is now up on CRAN too.