richardli/surveyPrev

Trouble getting getDHSindicator to work for Gambia data

Opened this issue · 1 comments

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 = "nickhadj@uw.edu", 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

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))