Re: [R] Can we prepare a questionaire in R

2011-06-14 Thread amrita gs
Hi all

So we can retrieve data from mysql database and do the data analysis in R.

Is it easy to do the data analysis with the values of the form elements
stored in mysql db,which are of different patterns for eg:- for radio
buttons there may be values yes or no,some may have textarea
values.Suppose i want to do a correlation analysis between these two how
is it possible
Can anyone give an example,Please.
Thanks

 Amrita

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-09 Thread Barry Rowlingson
On Thu, Jun 9, 2011 at 11:09 AM, amrita gs  wrote:
> I will explain more clearly
>
> I have an online feedback form which has all the form elements like
> radiobuttons,checkboxes,textareas,textboxes etc. I have to get the values of
> these form elements and use it for data analysis in R. It will be huge
> amount of data.
>
> 1) Is it possible in R to retrieve the values of these form elements
> directly.
>
> 2) Is there any storage mechanism in R to store the values.
> 2) Do i have to store the data in some files or db and then import them in
> R and use for data analysis. Is this better?

 Are you analysing individual forms independently and giving rapid
feedback? For example, a user puts some numbers in a box, clicks
'fit', and expects to see some parameters back and maybe a plot? Then
you need R integrated with the server.

 Or are you doing summaries of many form submissions perhaps weekly or
at the end of the study period?

 There's a problem with using R to store values coming from a web form
- concurrency. Suppose two people submit the form at more or less the
same time. If your web server back-end is using R to save the data you
need to make sure the two processes aren't trying to write to the same
file at the same time or you'll corrupt it. Databases such as Postgres
sort this out by having clever locking mechanisms.

 If you are doing 'batch' analysis like this then you don't need R
involved with the server at all, and things are much simpler. Just use
a web server back end that suits you (java servlet, PHP, python web
application framework) that takes the form data and adds it to a data
base such as Postgres or MySQL.

 Then to do the analysis, R can get the data from such DBs and you can
figure out how to produce your pie charts easily...

 You say you are a beginner in R, so best to leave it and use
something else for the web side of things. What aren't you a beginner
in?

Barry

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-09 Thread Santosh Srinivas
You question has multiple answers that you can choose from and the group has
been trying to help you.

My suggestion would be to write it to the database using PHP and use R to
extract and analyze (and write back) the data.

The integration of R with web functionality is quite nascent but the Rapache
seems to be working quite well. (You could check it out and post your
questions to the rapache mailing list after doing some homework).

You might want to try out these ideas hands-on and evaluate them for
yourself.



On Thu, Jun 9, 2011 at 3:39 PM, amrita gs  wrote:

> I will explain more clearly
>
> I have an online feedback form which has all the form elements like
> radiobuttons,checkboxes,textareas,textboxes etc. I have to get the values
> of
> these form elements and use it for data analysis in R. It will be huge
> amount of data.
>
> 1) Is it possible in R to retrieve the values of these form elements
> directly.
>
> 2) Is there any storage mechanism in R to store the values.
> 2) Do i have to store the data in some files or db and then import them in
> R and use for data analysis. Is this better?
>
> Amrita
>
>[[alternative HTML version deleted]]
>
> __
> R-help@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.
>

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-09 Thread amrita gs
I will explain more clearly

I have an online feedback form which has all the form elements like
radiobuttons,checkboxes,textareas,textboxes etc. I have to get the values of
these form elements and use it for data analysis in R. It will be huge
amount of data.

1) Is it possible in R to retrieve the values of these form elements
directly.

2) Is there any storage mechanism in R to store the values.
2) Do i have to store the data in some files or db and then import them in
R and use for data analysis. Is this better?

Amrita

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-09 Thread Graham Smith
>
>  1) Is there a way to populate html form element values directly into R or
> is it only possible to get the values into a db or an excel file or a csv
> file and import it for data analysis.
>

I realise this isn't exactly what you are asking, but it is a possible
solution. If you google or search these forums you will find information on
linking R to the spreadsheet in Google Docs.  With GoogleDocs you can create
forms that can be filled in online or via email, which automatically
populate a google spreadsheet.

Running the R code for the analysis then automatically updates with the
latest data from the spreadsheet.

So the analysis is always based on the latest data.

Not sure if that helps, but it may be worth exploring.

Graham

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-08 Thread amrita gs
Hai everyone,

 1) Is there a way to populate html form element values directly into R or
is it only possible to get the values into a db or an excel file or a csv
file and import it for data analysis.

If possible , please anyone reply to this mail. Am a beginner in R.

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-08 Thread Barry Rowlingson
On Wed, Jun 8, 2011 at 12:56 PM, amrita gs  wrote:
> How can we create HTML forms in R

 HTML is Just Plain Text, so you can create them using R's text output
'cat' function. E.g.

cat(' First name: Last name: ',
file="test.html")

 and job done. Open test.html in your web browser and there it is.

 Other packages may help you construct these things - search CRAN for
html, and also 'brewer' which is a handy package for making templates
which you can render into HTML.

 But to be honest, your question is way too general as stated to get a
decent response here.

Barry

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-08 Thread Matt Shotwell
As Mike had written, there are frameworks for web-development with R.
RApache http://www.rapache.net is one. Also, see the R package Rook:
http://cran.r-project.org/web/packages/Rook/index.html .

On Wed, 2011-06-08 at 17:26 +0530, amrita gs wrote:
> How can we create HTML forms in R

Wouldn't you rather create HTML forms in HTML? See the links above to
use R for server-side scripting, for example, to receive form data from
a web browser.

> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@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.

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-08 Thread amrita gs
How can we create HTML forms in R

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Can we prepare a questionaire in R

2011-06-08 Thread Mike Marchywka







> Date: Wed, 8 Jun 2011 12:37:33 +0530
> From: ammasamri...@gmail.com
> To: r-help@r-project.org
> Subject: [R] Can we prepare a questionaire in R
>
> Is there a way to prepare a questionnaire in R like html forms whose data
> can be directly populated into R?
>

I've started to use Rapache although Rserve would also be an option.
When installed on server, your can point your html form to an rhtml
page and get the form variables in R just as with other web languages.
For writing html output, I had been using R2HTML ( see code excerpt below
from rhtml page). I had also found Cairo works ok if you don't
need X-11 for anything. 

For your specific situation however, it may be easier to just
use whatever you already have and just use R for the data analysis.
When a request for a results report is made,  send that to Rapache for
example. I would mention that I have gone to running two versions
of Apache, one with R and one with PHP, to allow for security and
easier development( I can write the php to fail nicely if the R apache
server is not up and no new security issues are exposed). 


library("Cairo")
library("R2HTML")
library("RColorBrewer")


You can of course also generate html from normal R commands, or for that
matter bash scripts etc.

  
__
R-help@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.