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

Trouble getting getDHSindicator to work for Gambia data #4

Open
nickhadj1 opened this issue Feb 16, 2024 · 1 comment
Open

Trouble getting getDHSindicator to work for Gambia data #4

nickhadj1 opened this issue Feb 16, 2024 · 1 comment

Comments

@nickhadj1
Copy link

Hi there,

My name is Nick Hadjimichael, and I'm a student in Jon Wakefield's class. I have been struggling to get the following code to run (I've included the error)

#DHS small area estimation and mapping of womananemia in Gambia

library(devtools)
install_github("richardli/surveyPrev")
library(surveyPrev)

library(SUMMER)
library(rdhs)
library(ggplot2)
library(patchwork)
library(dplyr)
library(sf)

GambiaAdm1 <- read_sf(dsn = file.path("gadm41_GMB_shp/gadm41_GMB_1.shp"),stringsAsFactors = F)
GambiaAdm1 <- as_Spatial(GambiaAdm1)
GambiaAdm2 <- read_sf(dsn = file.path("gadm41_GMB_shp/gadm41_GMB_2.shp"),stringsAsFactors = F)
GambiaAdm2 <- as_Spatial(GambiaAdm2)

rdhs::set_rdhs_config(email = "[email protected]", project = "UW BIOST 555 Class Project: DHS small area estimation and mapping of womananemia in Gambia")

indicator <- "womananemia"
year <- 2013
country <- "Gambia"
dhsData <- getDHSdata(country = country, indicator = indicator, year = year)
data <- getDHSindicator(dhsData, indicator = indicator)

""

data <- getDHSindicator(dhsData, indicator = indicator)
Error in UseMethod("mutate") :
no applicable method for 'mutate' applied to an object of class "list"
""

in speaking with Katie Paulson, TA, in the class, we found that there's some bug here

Just thought I'd let you know!

Thank you kindly

Best,
Nick

@krpaulson
Copy link

I think it's specifically an issue with the syntax for this indicator, in these parts of the code:

AN_ANEM_W_ANY <- function(RData){

raw.dat.tmp <- AN_ANEM_W_ANY(list(IRdata = IRdata))

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

No branches or pull requests

2 participants