Data input

There are several ways to input data into an Rpad. For large datasets, like dataframes, you can use a TEXTAREA as follows. This textarea is transfered to the server as a file (in this case named 'states.csv'), which you can read into R. This allows the user to paste in new data if they want. This is the state.x77 data that comes as a built-in dataset with R (from 1977 census data).

Now for some R code. Textareas can also be used for R code blocks. This has the advantage that the user can edit the code on Mozilla browsers without the Mozile plugin. It also allows larger code chunks that don't take up as much screen space.

Read in and plot this data:

You can also use HTML input boxes, so the user can enter single-valued data into R. There are two types of R variables that can be associated with an Rpad input box. One is "Rvariable" and it is an R expression, so it can contain 1.33 or 2*pi or 3*x + sum(3,6,7). The other is "Rstring" and it is transfered to R as a character string. On Mozilla, the Rstring is colored blue to differentiate it (with a little CSS that IE doesn't support). You can change the name of the R variable and the type of R variable with the input and selection boxes at the upper right of the browser page. Here are two Rpad variables called myvar and myname.

myvar: myname:

After fiddling with some of the inputs, hit F9 or the calculate button and see that the following outputs change:




by Tom Short, tshort@epri.com, Copyright 2005. EPRI, license: GNU GPL v2 or greater