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)
muscatine$y
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 wrote:
>
>> "1 (472)" "2 (445)" "3 (431)" "3 (431)" "5 (415)" "6 (
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 wrote:
> "1 (472)" "2 (445)" "3 (431)" "3 (431)" "5 (415)" "6 (405)" "7 (1)
Benno Pütz
Statistical Genetics
MPI of Psychia
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() wont
work because the
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" wrote:
>Hello,
>
>Maybe something like the following.
>
>#install.packages("XML", dep = TRUE)
>
>library(XML)
>
>url <-
>
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 (X)
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
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 wi
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. "stm
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_nam
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 this
Hello,
Maybe something like the following.
#install.packages("XML", dep = TRUE)
library(XML)
url <-
"http://games.crossfit.com/scores/leaderboard.php?stage=1&sort=0&division=1®ion=0&numberperpage=60&page=0&competition=0&frontpage=0&expanded=0&full=1&year=14&showtoggles=0&hidedropdowns=0&showa
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 t
13 matches
Mail list logo