Hi R users, Is there a Package in R to - set up a questionnaire? - enter data? Best regards -- View this message in context: http://www.nabble.com/A-package-to-set-up-a-questionnaire---enter-data-tp20947237p20947237.html Sent from the R help mailing list archive at Nabble.com.
justin bem
2008-Dec-11 06:50 UTC
[R] Re : A package to set up a questionnaire & enter data
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20081211/1ca69796/attachment.pl>
CE.KA wrote:> Hi R users, > Is there a Package in R to > - set up a questionnaire? > - enter data? >Hi CE.KA, I don't know, but I have written a general purpose questionnaire program in Tcl-Tk that will administer the questionnaire and record the responses. If you don't find anything, let me know. Jim
Hello, For entering data alone, you would not need a package. For simple questionnaires, you could write a function. It could go like this. For example you want to record people's names and their ages: # Sets up an empty database database <<- c() enter_data <- function() { show("Enter name:") name <- as.character(readline()) show("Enter age:") age <- as.numeric(readline()) # Appends data from one questionnaire to the # database database <<- rbind(database,data.frame(name,age)) # Calls the function in order to proceed # with another questionnaire enter_data() # stop the function using the "stop" button when you are finished } exporting "database" into a CSV or a text file should not be a problem with write.csv() or write.csv2(). Kind regards, David Croll
cryan at binghamton.edu
2008-Dec-11 13:47 UTC
[R] A package to set up a questionnaire & enter data
Not an R package, but EpiData is free software designed to to exactly this. It's a wonderful piece of software. Define fields, add annotations, provide defaults, provide allowable values or ranges, calculate one field based on entry to another, conditional skipping from one question to another depending on answer, relational database capaability, double-entry verification, and more. I don't think it exports directly to Rdata format, but it can export to plain text, SAS, Stata, dBase, and Excel, any of which I think can be read into R. --Chris Ryan ---- Original message ---->Date: Thu, 11 Dec 2008 12:51:10 +0100 >From: David Croll <david.croll at gmx.ch> >Subject: Re: [R] A package to set up a questionnaire & enter data >To: r-help at r-project.org > > > >Hello, > >For entering data alone, you would not need a package. For simple >questionnaires, you could write a function. > >It could go like this. For example you want to record people's names and >their ages: > ># Sets up an empty database >database <<- c() > >enter_data <- function() { > show("Enter name:") > name <- as.character(readline()) > > show("Enter age:") > age <- as.numeric(readline()) > > # Appends data from one questionnaire to the > # database > database <<- rbind(database,data.frame(name,age)) > > # Calls the function in order to proceed > # with another questionnaire > > enter_data() > > # stop the function using the "stop" button when you are finished > } > >exporting "database" into a CSV or a text file should not be a problem >with write.csv() or write.csv2(). > > > >Kind regards, > > >David Croll > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.