Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes subsetting in extract_related_topics and data processing for Namibia #353

Merged
merged 4 commits into from
Jun 27, 2020

Conversation

joachim-gassen
Copy link
Contributor

@joachim-gassen joachim-gassen commented Jun 6, 2020

Thank you for this great package! I use it to pull corona-related search volume for my package {tidycovid19}. This PR tries to fix to issues that I encountered using your package

  1. Recently, I had users noticing that gtrends() calls fail at times with the error message
Error in `[<-.data.frame`(`*tmp*`, , timevar, value = "subject") : replacement has 1 row, data has 0

This might be related to #352 but in my use case we do not download search volume for specific categories. I traced the error down to extract_related_topics() and identified an issue in the subsetting of raw_data as end is calculated relative to i and then raw_data is subsetted to i:end which seems to make no sense. This PR fixes the issue for me but I am not sure whether it addresses the issue correctly so discretion is advised.

  1. Importing the country code data creates missing values for the ISO2c code of Namibia ("NA") as read.csv() treats "NA" as missing by default. The second commit fixes this. The data commit is redundant if you run process_data.R after applying the commit.

Thank you for looking into this!

Joachim

@joachim-gassen joachim-gassen changed the title Fixes subsetting bug in extract_related_topics() Fixes subsetting in extract_related_topics and data processing for Namibia Jun 6, 2020
@PMassicotte
Copy link
Owner

Thank you, Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants