Skip to content

Commit

Permalink
v0.6.2 corrections for #79 issue with haven labels
Browse files Browse the repository at this point in the history
  • Loading branch information
OJWatson committed Feb 28, 2019
1 parent cb75da5 commit fdaa94d
Show file tree
Hide file tree
Showing 72 changed files with 110 additions and 99 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rdhs
Type: Package
Title: API Client and Dataset Management for the Demographic and Health Survey (DHS) Data
Version: 0.6.1.900
Version: 0.6.2
Authors@R:
c(person(given = "OJ",
family = "Watson",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## rdhs 0.6.2

* Duplicate labels when parsing flat data files corrected (#79)

## rdhs 0.6.1

* `extraction(add_geo=TRUE)` correction for Kenya 2014 surveys (#67)
Expand Down
41 changes: 20 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ Obtain survey estimates for Malaria prevalence among children from the Democrati

```r
dhs_indicators(indicatorIds = "ML_PMAL_C_RDT", returnFields=c("IndicatorId", "ShortName"))
#> ShortName IndicatorId
#> 1: Malaria prevalence according to RDT ML_PMAL_C_RDT
#> ShortName IndicatorId
#> 1 Malaria prevalence according to RDT ML_PMAL_C_RDT

dhs_data(countryIds = c("CD","TZ"), indicatorIds = "ML_PMAL_C_RDT", surveyYearStart = 2013,
returnFields=c("Indicator", "SurveyId", "Value", "SurveyYearLabel", "CountryName"))
#> Indicator SurveyId SurveyYearLabel Value
#> 1: Malaria prevalence according to RDT CD2013DHS 2013-14 30.8
#> 2: Malaria prevalence according to RDT TZ2015DHS 2015-16 14.4
#> 3: Malaria prevalence according to RDT TZ2017MIS 2017 7.3
#> CountryName
#> 1: Congo Democratic Republic
#> 2: Tanzania
#> 3: Tanzania
#> Indicator SurveyId SurveyYearLabel Value
#> 1 Malaria prevalence according to RDT CD2013DHS 2013-14 30.8
#> 2 Malaria prevalence according to RDT TZ2015DHS 2015-16 14.4
#> 3 Malaria prevalence according to RDT TZ2017MIS 2017 7.3
#> CountryName
#> 1 Congo Democratic Republic
#> 2 Tanzania
#> 3 Tanzania
```

### Identify survey datasets
Expand All @@ -95,11 +95,11 @@ Now, obtain survey microdatasets to analyze these same indicators. Query the *su
sc <- dhs_survey_characteristics()
sc[grepl("Malaria", sc$SurveyCharacteristicName), ]
#> SurveyCharacteristicID SurveyCharacteristicName
#> 1: 96 Malaria - DBS
#> 2: 90 Malaria - Microscopy
#> 3: 89 Malaria - RDT
#> 4: 57 Malaria module
#> 5: 8 Malaria/bednet questions
#> 57 96 Malaria - DBS
#> 58 90 Malaria - Microscopy
#> 59 89 Malaria - RDT
#> 60 57 Malaria module
#> 61 8 Malaria/bednet questions
```

Use `dhs_surveys()` identify surveys for the countries and years of interest.
Expand All @@ -119,7 +119,7 @@ Lastly, identify the datasets required for download. By default, the recommended
```r
datasets <- dhs_datasets(surveyIds = survs$SurveyId, fileFormat = "FL", fileType = "PR")
str(datasets)
#> Classes 'data.table' and 'data.frame': 3 obs. of 13 variables:
#> 'data.frame': 3 obs. of 13 variables:
#> $ FileFormat : chr "Flat ASCII data (.dat)" "Flat ASCII data (.dat)" "Flat ASCII data (.dat)"
#> $ FileSize : int 6595349 6622102 2172102
#> $ DatasetType : chr "Survey Datasets" "Survey Datasets" "Survey Datasets"
Expand All @@ -133,7 +133,6 @@ str(datasets)
#> $ DHS_CountryCode : chr "CD" "TZ" "TZ"
#> $ FileName : chr "CDPR61FL.ZIP" "TZPR7AFL.ZIP" "TZPR7QFL.ZIP"
#> $ CountryName : chr "Congo Democratic Republic" "Tanzania" "Tanzania"
#> - attr(*, ".internal.selfref")=<externalptr>
```

### Download datasets
Expand Down Expand Up @@ -163,17 +162,17 @@ The path to your config is saved between sessions so you only have to set this o
microbenchmark::microbenchmark(dhs_datasets(surveyYearStart = 1986),times = 1)
#> Unit: seconds
#> expr min lq mean median
#> dhs_datasets(surveyYearStart = 1986) 2.077998 2.077998 2.077998 2.077998
#> dhs_datasets(surveyYearStart = 1986) 1.810807 1.810807 1.810807 1.810807
#> uq max neval
#> 2.077998 2.077998 1
#> 1.810807 1.810807 1

# after caching, results will be available instantly
microbenchmark::microbenchmark(dhs_datasets(surveyYearStart = 1986),times = 1)
#> Unit: milliseconds
#> expr min lq mean median
#> dhs_datasets(surveyYearStart = 1986) 1.684018 1.684018 1.684018 1.684018
#> dhs_datasets(surveyYearStart = 1986) 1.582677 1.582677 1.582677 1.582677
#> uq max neval
#> 1.684018 1.684018 1
#> 1.582677 1.582677 1
```

Now download datasets by providing a list of desired dataset filenames.
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"codeRepository": "https://ropensci.github.io/rdhs/",
"issueTracker": "https://github.com/ropensci/rdhs/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.6.1.900",
"version": "0.6.2",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -306,7 +306,7 @@
],
"releaseNotes": "https://github.com/ropensci/rdhs/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/rdhs/blob/master/README.md",
"fileSize": "537.042KB",
"fileSize": "628.102KB",
"contIntegration": [
"https://travis-ci.org/ropensci/rdhs",
"https://codecov.io/github/ropensci/rdhs?branch=master"
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Test environments
* local Windows 7 x64, R 3.5.1
* local Linux 4.15.0-39-generic, R 3.5.1
* local Linux 4.15.0-39-generic, R 3.5.2
* local OS X, R 3.5.1

## R CMD check results
Expand Down
2 changes: 1 addition & 1 deletion docs/CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/TODO.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/anemia.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/client.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/country_codes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/geojson.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/introduction.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/testing.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/toolkit.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/issue_template.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pull_request_template.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/as_factor.labelled.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/authenticate_dhs.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fdaa94d

Please sign in to comment.