[R] Is it possible to include shiny code in a package?

2014-03-02 Thread Marc Girondot
Dear list member, I would like to include shiny code within a package. My idea was to include a folder 'shiny' for example and to put in this folder the files server.R and ui.R required for shiny as well as the css file and a style.R file that call this css file. Is it possible ? When I call

Re: [R] Extract Data form Website Tables

2014-03-02 Thread Rui Barradas
Hello, Maybe something like the following. #install.packages(XML, dep = TRUE) library(XML) url -

Re: [R] Is it possible to include shiny code in a package?

2014-03-02 Thread Uwe Ligges
On 02.03.2014 08:59, Marc Girondot wrote: Dear list member, I would like to include shiny code within a package. My idea was to include a folder 'shiny' for example and to put in this folder the files server.R and ui.R required for shiny as well as the css file and a style.R file that call

Re: [R] test the return from grep or agrep

2014-03-02 Thread Prof Brian Ripley
On 01/03/2014 23:32, Hui Du wrote: Hi All, My sample code looks like options(stringsAsFactors = FALSE); clean = function(x) { loc = agrep(ABC, x$name); x[loc,]$new_name - NEW; x; } name = c(12, dad, dfd); y = data.frame(name = as.character(name), idx = 1:3); y$new_name =

Re: [R] include sql statements

2014-03-02 Thread Duncan Murdoch
On 14-03-02 8:06 AM, normannus wrote: Am 28.02.2014 20:54, schrieb Duncan Murdoch: On 28/02/2014 5:16 AM, Streng Ge-heim wrote: Hi, first of all: I am new to R. Anyway, I would like to include sql files in my r-script, which I load via source(scriptname) in the CLI. The sql files (i.e.

Re: [R] include sql statements

2014-03-02 Thread normannus
Am 28.02.2014 20:54, schrieb Duncan Murdoch: On 28/02/2014 5:16 AM, Streng Ge-heim wrote: Hi, first of all: I am new to R. Anyway, I would like to include sql files in my r-script, which I load via source(scriptname) in the CLI. The sql files (i.e. stmt.sql) contains select statements with

Re: [R] include sql statements

2014-03-02 Thread Jeff Newmiller
R does not require the begin and end quote marks for string literals to be on the same line. There is nothing preventing you from formatting your SQL to your preference right in within R code. --- Jeff Newmiller

[R] gamm design matrices

2014-03-02 Thread Jarrod Hadfield
Hi All, I would like to fit a varying coefficient model using MCMCglmm. To do this it is possible to reparameterise the smooth terms as a mixed model as Simon Wood neatly explains in his book. Given the original design matrix W and penalisation matrix S, I would like to find the fixed

Re: [R] Extract Data form Website Tables

2014-03-02 Thread Doran, Harold
This is fantastic, thank you. I¹ve modified the code to loop through all the pages and grab all rows of the HTML table. Thank you, Rui. On 3/2/14, 5:08 AM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Maybe something like the following. #install.packages(XML, dep = TRUE) library(XML)

[R] Pattern Matching

2014-03-02 Thread Doran, Harold
Suppose I have a character vector as follows: aa [1] 1 (472) 2 (445) 3 (431) 3 (431) 5 (415) 6 (405) 7 (1)” I want to extract the values within parentheses and place them into a column that is numeric. The values in aa vary in length and so using strsplit() won’t work because the positions

Re: [R] Pattern Matching

2014-03-02 Thread Benno Pütz
Try as.numeric(sub(.*\\(,, sub('\\)','',aa))) You may also want to look at regexec/regmatches for a more general approach ... On 02 Mar 2014, at 20:55, Doran, Harold hdo...@air.org wrote: 1 (472) 2 (445) 3 (431) 3 (431) 5 (415) 6 (405) 7 (1)” Benno Pütz Statistical Genetics MPI of Psychiatry

Re: [R] Pattern Matching

2014-03-02 Thread Ted Harding
On 02-Mar-2014 20:12:57 Benno Pütz wrote: Try as.numeric(sub(.*\\(,, sub('\\)','',aa))) You may also want to look at regexec/regmatches for a more general approach ... On 02 Mar 2014, at 20:55, Doran, Harold hdo...@air.org wrote: 1 (472) 2 (445) 3 (431) 3 (431) 5 (415) 6 (405) 7 (1)”

Re: [R] geeglm error NA/NaN/Inf in 'y'

2014-03-02 Thread Brant Inman
I have been able to isolate the problem, though I still do not understand why this is occurring. Consider the following code: # library(foreign) muscatine - read.dta('http://www.hsph.harvard.edu/fitzmaur/ala2e/muscatine.dta') muscatine$gender - as.factor(muscatine$gender)