Coder Social home page Coder Social logo

epidata-xml-to-r's People

Contributors

daudi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

epidata-xml-to-r's Issues

Error in xmlChildren(these.data)[[i]] : subscript out of bounds

Hello,
Thank you for your code.
I am a statistician and a R beginner. I need to import multiple files .epx from Epidata and your code would be very usefull.
Unfortunatly, error "Error in xmlChildren(these.data)[[i]] : subscript out of bounds" is generated when I run your code. Any idea to help me?
Thank you again for your code and your help,
Laura

convert EpiData logical

Hi David,
Logical type is not well documented

Field type = 0
Can have values "Y", "N" or be blank (system missing); value labels not allowed as far as I know.

conversion code:

} else if (fld.type == 0){
## Logical - empty to NA, Y to TRUE, else to FALSE
x[x==""] <- NA
x <- x=="Y"

Jamie

Deal with potential inconsistency between labels and data

It is possible to enter data, and later add labels that do not include all of the values entered previously. Importing such a file causes the application of labels to fail because the factor levels don't match.

Detect it, report it, and attempt to apply the labels where possible.

From Jamie: Perhaps give a warning and assign value label such as "Unknown label 1" so that every value would have a corresponding unique label.

But might be better to leave the data originally entered, as this would allow the user to know what the values were and recode manually in R.

Filter rows on import

I think it should be possible to use handlers in xmlTreeParse() to filter rows when parsing the epidata XML file. This could be useful if the file is very large and there is a meaningful way of using a subset (perhaps random selection, or rows that match certain criteria).

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.