Code Monkey home page Code Monkey logo

ddsqltools's Introduction

cimentadaj

The goal of cimentadaj is to …

Installation

You can install the released version of cimentadaj from CRAN with:

install.packages("cimentadaj")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("cimentadaj/cimentadaj")

Example

This is a basic example which shows you how to solve a common problem:

library(cimentadaj)
## basic example code

What is special about using README.Rmd instead of just README.md? You can include R chunks like so:

summary(cars)
#>      speed           dist       
#>  Min.   : 4.0   Min.   :  2.00  
#>  1st Qu.:12.0   1st Qu.: 26.00  
#>  Median :15.0   Median : 36.00  
#>  Mean   :15.4   Mean   : 42.98  
#>  3rd Qu.:19.0   3rd Qu.: 56.00  
#>  Max.   :25.0   Max.   :120.00

You’ll still need to render README.Rmd regularly, to keep README.md up-to-date.

You can also embed plots, for example:

In that case, don’t forget to commit and push the resulting figure files, so they display on GitHub!

ddsqltools's People

Contributors

cimentadaj avatar mpascariu avatar timriffe avatar

Watchers

 avatar

ddsqltools's Issues

Reestablish collapsing ID and Name columns

Combining the *Name and *ID columns with get_recorddata seems to be an idea that Patrick likes. However, dplyr::bind_rows and rbind seem to have some trouble merging haven labels. I've reported it here: https://github.com/tidyverse/dplyr/issues/5492

When this is fixed, make sure you restore the haven labels inside get_recorddata. In the mean time, the code will be commented out, as well as the vector with the *Name and *ID pairs in Utils_Get.R.

Fix message from output_msg

Some heaping methods are now called check_heaping_*, when the output_msg function refers to the old name.

Update sortOrder columns

The API will eventually do this:

The recordset that come out from the structureddatarecordsadditional queries, I see that they include the extra SortOrder fields I asked, but the names return include only “Sort” as suffix. Can you label them with SortOrder as suffix. I also noticed that you are returning SubGroupTypeSortOrder, can you also return SubGroupSortOrder.

Since get_recorddata does column subsetting, you'll need to update this subset of columns to include these new columns and rename the Sort columns to SortOrder.

Create tests for indicatorIds/indicatorTypeIds/dataProcessIds/dataProcessTypeIds

After a long discussion Dennis now allows get_recorddata to accept these two sets of arguments:

  • indicatorIds or indicatorTypeIds
  • dataProcessIds or dataProcessTypeIds

We need to add some tests checking that, for example, if I set indicatorTypeIds=8, the result should contain many different indicatorIds such as 58, 60, 311. Conversely, if I specify indicatorId=58, the resulting indicatorIds should only be 58. Although this comes directly from the API, a test on this could flag the UNPD whether something is off.

Similarly, we need to apply this for dataProcessTypeIds and dataProcessIds, dataProcessTypeIds being the umbrella that contains several values of dataProcessIds.

Just so I don't forget, here's an example that Patrick mentioned that will allow me to implement this for indicatorTypeIds:

For a country like AFG (locID=4) indeed the recordsets are limited so you are going to see similar recordsets based on these two sets of queries. Try with India (locIds=356). But if isComplete=0 is also used in these queries, iot helps also to narrow the list of indicator.

I sent him these two problems:

'# With indicatorTypeIds = 8, this result should contain results for all indicatorIds 58, 60, 311, etc.. when in fact we only get 58
http://24.239.36.16:9654/un3/api/structureddatarecordsadditional?dataProcessIds=2&startYear=1920&endYear=2020&indicatorTypeIds=8&isComplete=0&locIds=4&locAreaTypeIds=2&subGroupIds=2

'# With indicatorIds = 58 we get the same result as above
http://24.239.36.16:9654/un3/api/structureddatarecordsadditional?dataProcessIds=2&startYear=1920&endYear=2020&indicatorIds=58&isComplete=0&locIds=4&locAreaTypeIds=2&subGroupIds=2

and he responded with:

A more meaningful test of these differences can be seen if you use IndicatorTypeID=29, you’ll get a collection of life table indicators. If isComplete=0 is used you’ll get only the indicators only for abridged life tables. But if we use directly IndicatorID=245 we should get only “m(x,n) – abridged”

There's no current example for this on dataProcessTypeIds and we should get one from them

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.