Displaying 20 results from an estimated 2000 matches similar to: "Regexp subexpression"
2005 May 18
1
from list to dataframe
I was wondering if someone can help me figure out the following:
I have two patient datasets, ds1 and ds2. ds1 has fields "patid", "date",
and "lab1". ds2 has "patid", "date", and "lab2". I want to find all the
patids that have at least 2 dated records for each lab. I started by
splitting each dataset by patid, to create ds1.list
2004 Sep 22
1
impenetrable warning
Dear R-help,
Can anyone explain the meaning of the warning,
Singular precision matrix in level -1, block 1
? Or how to track down where it comes from?
More precisely, using the nlme package, I'm issued with the warning
itt2 <- lme(lrna~rx.nrti+lbrna, random=~1|patid,
cor=corExp(form=~days|patid,nugget=T), weights=varPower(
form=~lbrna),data=rna3)
Warning messages:
1: Singular
2012 Nov 17
3
manipulating longitudinal data in r
Dear list member,
I have the following data example
ke <- data.frame(patid=c(1,1,1,2,3,3),a=c(1,2,2,1,1,2))
I want to add another variable b, such that the max of 'a' by id is returned
i.e data ke becomes
ke <- data.frame(patid=c(1,1,1,2,3,3),a=c(1,2,2,1,1,2),b=c(2,2,2,1,2,2))
Any help will be appreciated.
Oluwakemi
[[alternative HTML version deleted]]
2003 May 14
2
number of patients in a hospital on a given date
Dear R-users!
I am using R 1.7.0, under Windows XP.
Having some hospital discharge data (admission date and discharge date for
each patient), I want to get the number of patients in the hospital on a
given date.
My data look like (simple example):
> x <- data.frame(patid=c("pat1", "pat2"), adm.date = c("15.03.2002",
"16.03.2002"),
2005 May 24
3
obtaining first and last record for rows with same identifier
I have a dataframe that contains fields such as patid, labdate, labvalue.
The same patid may show up in multiple rows because of lab measurements on
multiple days. Is there a simple way to obtain just the first and last
record for each patient, or do I need to write some code that performs that.
Thanks,
Steven
1997 May 22
1
No subject
Does anyone have a description of the S help format?
-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
2007 Mar 27
1
basic handling of data.frame
Hello,
I'm new to R but wan't to use it to compute the statistics of my medical study.
The study includes several parameters for a number of patients. Each
parameter was assessed by a number of readers, once with a special
condition, once without.
Now I have a data.frame with colums like:
PatientID, ReaderID, SpecialCond(yes/no), Parameter1, Parameter2.....
the rows are not sorted, and
2008 Oct 31
1
subset with variable number of subset arguments
I've got a big data.frame from which I need to extract data based on a variable number of Id's (InfCode).
Until now I've been using the following dull solution as I never needed to search for more than 5 codes.
Now my needs have increased faster than my R skills did and I need to call my function with about 25 values for x.
There has to be a *apply or even simpler solution which
2009 Feb 25
3
regexp capturing group in R
Hello,
Newbie question: how do you capture groups in a regexp in R?
Let's say I have txt="blah blah start=20080101 end=20090224".
I'd like to get the two dates start and end.
In Perl, one would say:
my ($start,$end) = ($txt =~ /start=(\d{8}).*end=(\d{8})/);
I've tried:
txt <- "blah blah start=20080101 end=20090224"
m <-
2008 Mar 18
0
Subexpression usage in Asterisk Dialplan Regular Expressions
Hi,
I currently have these two lines in my dialplan to extract different parts
out of a variable and I'd like to do it in one line instead. Does anyone
know how to use regular expression subexpressions in the dialplan?
Outputting a comma separated list that can be sent to ARRAY() would be nice
too (tried that, didn't work -- only got the first subexpression).
;extract dialed number
2008 Nov 28
3
regexp help needed
Hello,
I have a vector of dates and I would like to grep the year component
from this vector (= all digits
after the last punctuation character)
dates <- c("28.7.08","28.7.2008","28/7/08", "28/7/2008", "28/07/2008",
"28-07-2008", "28-07-08")
the resulting vector should look like
"08" "2008"
2006 Nov 09
1
invert argument in grep
Hello,
What about an `invert` argument in grep, to return elements that are
*not* matching a regular expression :
R> grep("pink", colors(), invert = TRUE, value = TRUE)
would essentially return the same as :
R> colors() [ - grep("pink", colors()) ]
I'm attaching the files that I modified (against today's tarball) for
that purpose.
Cheers,
Romain
--
2007 May 22
1
regexp bug in very recent r-devel
completion is semi-broken in today's r-devel, and the reason seems to
be some regular expression changes:
> sessionInfo()
R version 2.6.0 Under development (unstable) (2007-05-22 r41673)
i686-pc-linux-gnu
locale:
[...]
attached base packages:
[1] "stats" "graphics" "grDevices" "utils" "datasets" "methods"
[7]
2008 Oct 16
1
[LLVMdev] Local common subexpression elimination
Hi all,
Is there any existing pass that performs fast local common subexpression
elimination?
The reason I'm asking is because global common subexpression elimination
(GVN or GVN-PRE) is too slow for my JIT purposes, but I see lots of value in
local CSE.
Thanks,
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
[LLVMdev] A question about GetElementPtr common subexpression elimination/loop invariant code motion
2007 Jan 29
0
[LLVMdev] A question about GetElementPtr common subexpression elimination/loop invariant code motion
On Mon, 29 Jan 2007, Gil Dogon wrote:
> Now the problem with this code , is that the calculation of the address
> mat[i][j] which is done by the (two) getelementptr instructions
> is quite expensive (involving at least two multiplications and one
> addition) hence it actualy should have been moved out of the inner loop.
Right.
> and not twice. Anyway this is just a syptom of a
[LLVMdev] A question about GetElementPtr common subexpression elimination/loop invariant code motion
2007 Jan 29
2
[LLVMdev] A question about GetElementPtr common subexpression elimination/loop invariant code motion
Hello.
I have a problem which is quite basic for array optimization, amd I
wonder whether I am missing something, but I could not
find the LLVM pass that does it.
Consider the following code snippet:
int test()
{
int mat[7][7][7];
int i,j,k,sum=0;
for(i=0;i<7;i++){
for(j=0;j<7;j++){
for(k=0;k<7;k++){
sum+=mat[i][j][k]^mat[i][j][k^1];
}
}
}
return
2005 Jan 31
2
Extracting a numeric prefix from a string
Hi
Does anyone know if there is a function similar to as.numeric that will
extract a numeric prefix from a string as in the following examples?
x<-c(3, "abc", 5.67, "2.4a", "6a", "6b", "2.4.a", 3, "4.2a")
df.x<-data.frame(Code=x)
x.str<-levels(df.x[,1])
# required function result
2.40 3.00 4.20 5.67 6.00 NA
Thanks
Mike White
2012 Aug 06
5
regexpr with accents
Hello,
I have build a syntax to find out if a given substring is included in a larger string that works like this:
d1$V1[regexpr("some text = 9",d1$V2)>0] <- 9
and this works all right till "some text" contains standard ASCII set. However, it does not work when accents are included as the following:
d1$V1[regexpr("some t?xt = 9",d1$V2)>0] <- 9
I have
2003 Aug 13
7
Regexpr with "."
I'm trying to use the regexpr function to locate the decimal in a character
string. Regardless of the position of the decimal, the function returns 1.
For example,
> regexpr(".", "Female.Alabama")
[1] 1
attr(,"match.length")
[1] 1
In trying to figure out what was going on here, I tried the below command:
> gsub(".", ",",
2008 Apr 15
1
why does regexpr not work with '.'
Dear R Helpers,
I am running R 2.6.2 on a Windows XP machine.
I am trying to use regexpr to locate full stops in strings, but, without
success.
Here an example:-
f="a,b.c at d:" #define an arbitrary test string
regexpr(',',f) #find the occurrences of ',' in f - should be one at location
2
# and this is what regexpr finds
#[1] 2