Displaying 20 results from an estimated 10000 matches similar to: "perhaps regular expression bug with | sign ??"
2013 Sep 02
1
Sweave: printing an underscore in the output from an R command
I am working with Sweave and would like to print out into my latex document the result of the R command
version$platform
So what I first tried in my .Rnw document was \Sexpr{print(version$platform)}.
However, the output from this command is the string "x86_64-apple-darwin10.8.0" (without the quotes). This contains an underscore, which is a special character in tex and so I get an error
2010 Feb 08
2
the hat ^ in regular expression
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100208/52a6d080/attachment.pl>
2009 May 13
4
matching period with perl regular expression
Hello,
I have several strings where I am trying to eliminate the period and
everything after the period, using a regular expression. However, I am
having trouble getting this to work.
> x = "wa.w"
> gsub(x, "\..*", "", perl=TRUE)
[1] ""
Warning messages:
1: '\.' is an unrecognized escape in a character string
2: unrecognized escape removed
2009 Sep 14
2
Escaping . in regular expression
If I run
cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f")
print(cvec)
indx<-grep('\.f',cvec,perl=TRUE)
fset<-cvec[indx]
print(fset)
I get
> cvec<-c("test.f", "test.sf", "try.g","try.res", "try.f")
> print(cvec)
[1] "test.f" "test.sf"
2004 Oct 28
2
POSIX time anomaly (PR#7317)
Full_Name: Allen McIntosh
Version: 2.0.0
OS: RedHat 9.0
Submission from: (NULL) (67.80.175.118)
The POSIX time printing routine gives strange results when asked to print a time
that is exactly midnight:
TZ=CST6CDT R -q --no-save
> strptime("10/5/2004 00:00:01 CDT", "%m/%d/%Y %H:%M:%S %Z")
[1] "2004-10-05 00:00:01"
> strptime("10/5/2004 00:00:00
2007 Jun 28
3
: regular expressions: escaping a dot
What's really the problem with:
> regexpr( '\.odt$', "xxxxYodt", perl=TRUE )
Warning: '\.' is an unrecognized escape in a character string
Warning: unrecognized escape removed from "\.odt$"
[1] 5
attr(,"match.length")
[1] 4
I know that I could use:
> regexpr( '[.]odt$', "xxxxYodt", perl=TRUE )
But it seems to me that
2009 Jun 08
2
help to speed up loops in r
Hi
i am using a script which involves the following loop. It attempts to reduce a data frame(zz) of 95000 * 41 down to a data frame (averagedreplicates) of 95000 * 21 by averaging the replicate values as you can see in the script below. This script however is very slow (2days). Any suggestions to speed it up.
NB I have also tried using rowMeans rather than adding the 2 values and dividing by 2.
2009 May 15
2
Help with loops
Hi
I am trying to create a loop which averages replicates in my data.
The original data has many rows. and consists of 40 column zz[,2:41] plus row headings in zz[,1]
I am trying to average each set of values (i.e. zz[1,2:3] averaged and placed in average_value[1,2] and so on.
below is my script but it seems to be stuck in an endless loop
Any suggestions??
for (i in 1:length(average_value[,1])) {
2009 Nov 04
4
unexpected results in comparison (x == y)
Dear readers of the list,
I have a problem a comparison of two data from a vector. The comparison
yields FALSE but should be TRUE. I have checked for mode(), length() and
attributes(). See the following code (R2.10.0):
-----------------------------------------------
# data vector of 66 double data
X =
2009 May 15
1
Fw: Help with loops(corrected question)
--- On Fri, 15/5/09, Amit Patel <amitrhelp at yahoo.co.uk> wrote:
> From: Amit Patel <amitrhelp at yahoo.co.uk>
> Subject: Help with loops
> To: r-help at r-project.org
> Date: Friday, 15 May, 2009, 12:17 PM
> Hi
> I am trying to create a loop which averages replicates in
> my data.
> The original data has many rows. and consists of 40 column
> zz[,2:41]
2012 Apr 10
7
How to remove $ (Dollar sign) from string
How do I remove a "$" character from a string sub() and gsub() with "$" or
"\$" as pattern do not work.
> sub("$","","ABC$DEF")
[1] "ABC$DEF"
> sub("\$","","ABC$DEF")
Error: '\$' is an unrecognized escape in character string starting "\$"
>
2008 Jul 30
1
model mix problem. FALSE CONVERGENCE
Hi R users
I try to use the lme but I can?t!!!!!
My script is (some words in french, sorry!!):
rm(list=ls(all=TRUE)) #Efface tous les objets en m?moire pour ?viter des
erreurs
library(MASS) #Chargement des Librairies
library(car)
library(Hmisc)
library(tkWidgets)
library(svDialogs)
library(multtest)
library(nlme)
#Rep <- "C:/Documents and Settings/U3M/Bureau/steph/Scripts
2010 Jun 22
4
seek() and gzfile() on 32-bit R2.12.0 in linux
I have installed both 32-bit and 64-bit versions of R2.12.0 (2010-06-15
r52300) on my Ubuntu 10.04 64-bit system. I observe the following behavior
when running the examples from base::connections. There appears to be a
problem with seek() on a .gz file when using a 32-bit installation of
R2.12.0, but the problem doesn't appear in the 64-bit installation. I
realize that seek() has been
2005 Aug 29
4
ttda on R 2.1.1: error
Hello,
I'm trying to use the package ttda, wich is involved in text analysis,
for my own data about answers in a company survey.
I've installed it, as well as ispell, but when trying to use an example:
> zz <- file("stupid.txt", "w") # build a data file
> cat("{comment - stupid data file} \n" , file = zz)
> cat("<uci=1>
2005 Jun 02
1
Wishlist: more flexible handling of tick labels in axis.Date (PR#7913)
Full_Name: Gavin Simpson
Version: 2.1.0-patched (1-Jun-2005)
OS: Linux (Fedora Core 3)
Submission from: (NULL) (128.40.32.76)
axis.Date() insists on labelling tick marks. It could be made more flexible by
allowing the user to specify if they want the ticks to be labelled, for example,
to add un-labelled minor ticks for "months", added to a plot with "years"
labelled. The user
2006 Jul 23
1
Iterated Data Input/Output with Random Forests
Hi,
I am currently writing code to input a few thousand files, run them through the
Random Forests package, and then output corresponding results.
When I use the code below:
zz<-textConnection("ex.lm.out", "w")
sink(zz)
2011 Feb 04
1
Dovecot 2 multiple address/port binding
Hello,
Sorry, I know the topic has been talked about already but I searched the
archives and I'm still unsure of the proper way to have dovecot (imap-login)
listen to several addresses and/or several ports.
1. how do I translate dovecot-1
protocol imap {
listen = xx.xx.xx.xx:143 yy.yy.yy.yy:143
ssl_listen = xx.xx.xx.xx:993 yy.yy.yy.yy:939
}
I started by
service imap-login {
2006 Aug 31
2
cumulative growth rates indexed to a common starting point over n series of observations
What is the R way of computing cumulative growth rates given a series of
discrete values indexed .
For instance, given a matrix of 20 observations for each of 5 series (zz),
what is the most straight forward technique in R for computing cumulative
growth (zzcum) ?
It seems for the solution I'm after might be imbedding the following cum
growth rate calc as a function into a function call
2006 Oct 12
2
plot.POSIXct
I've never had any issues with the way that plot.POSIXct chooses the
labels of the date axis before, but in this particular case it's output
is a little confusing.
plot(seq(as.POSIXct("1997-10-01"),length.out=108,by="month"),rnorm(108))
This command produces a chart with every x tick mark labeled as "Jan
01".
I can replicate this chart by adding the format
2013 Apr 08
2
cbind for list of zoo objects
Can someone explain why this happens when one of the list elements is named 'all'?
> zz <- list( zoo(1:10,1:10), zoo(101:110,1:10), zoo(201:210,1:10) )
> names(zz)<-c('test','bar','foo')
> do.call(cbind,zz)
test bar foo
1 1 101 201
2 2 102 202
3 3 103 203
4 4 104 204
5 5 105 205
6 6 106 206
7 7 107 207
8 8 108 208
9