similar to: Parenthesis recognition with grep

Displaying 20 results from an estimated 6000 matches similar to: "Parenthesis recognition with grep"

2009 Aug 21
2
Problem with passing a string to subset
Dear R-users, The following question bothered me for the whole afternoon: how can one pass a string as the conditioning argument to subset? I tried plain mystr, eval(mystr), expression(mystr), etc... I don't to be able to find the correct syntax > foo <- data.frame(a=1:10,b=10:1,c=rep(1:2,5)) > mystr<-"c==1" > subset(foo,c==1) a b c 1 1 10 1 3 3 8 1 5 5 6
2009 Sep 15
1
Regular expression problem
Dear R-users, I am trying to use the grep function to test whether a particular string is of the form "n.../mydir/myfile.mytype.myext". Anything between n and mytype could vary, and anything after mytype could vary. I tried to proceed by steps to build my regular expression... but I do not really understand why the last call of the following code do not work. Any help would be
2011 Dec 06
2
How to automate the detection of break points for use in cut
Dear R-users, I would like to know if there is a function (in base R or the extension packages) that would automatically detect the break points in a vector x for later use in the cut function. The idea is to determine the boundaries of the n intervals (n>=1) delimiting clusters of data points which could be considered "reasonably" close, given a numerical vector x with unknown
2007 May 11
1
Cannot use an escape character in regexp
Given the string > mystr <- "(Preconsuntivo del giorno gas 10 maggio 2007)Tj" I'm trying to detect and eliminate the string ")Tj" at the very end of mystr by means of gsub(rx2,"",mystr) BUT preparing the matching regexp string a warning pops up > rx2 <- "\)Tj$" Warning messages: 1: '\)' is an unrecognized escape in a
2011 Feb 10
1
about prediction with a factor
Hi, I don't know how to make prediction with a factor in the linear model. Say yd=c(1,2,3,4,5) > sl=c(2,3,4,5,6) > sex=c("male","male","female","female","male") > sex=factor(sex) > m=lm(sl~yd+sex+sex:yd) How to make a prediction with new data like yd=c(4,5,6,7,8) for male and female separately ? Thank you very
2010 Nov 08
1
try (nls stops unexpectedly because of chol2inv error
Hi, I am running simulations that does multiple comparisons to control. For each simulation, I need to model 7 nls functions. I loop over 7 to do the nls using try if try fails, I break out of that loop, and go to next simulation. I get warnings on nls failures, but the simulation continues to run, except when the internal call (internal to nls) of the chol2inv fails.
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list, I am not sure if this request is a "ticket" that should be filled somewhere outside the mailing list. If so, I apologize for not doing and would like to know where I should have filled it. And to the subject matter: I would like to use a command like this: plot(c(1,8), 1:2, type="n") polygon(1:7, c(2,1,2,NA,2,1,2),
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list, I am not sure if this request is a "ticket" that should be filled somewhere outside the mailing list. If so, I apologize for not doing and would like to know where I should have filled it. And to the subject matter: I would like to use a command like this: plot(c(1,8), 1:2, type="n") polygon(1:7, c(2,1,2,NA,2,1,2),
2009 Oct 28
1
New variables "remember" how they were created?
Hello all, I hope this question is appropriate for this ML. Basically, I am wondering if when you create a new variable, if the variable holds some information about how it was created. Let me explain, I have the following code to replicate an example in a textbook (Greene's Econometric Analysis), using the systemfit package. dta <-
2011 Jun 08
1
Autocorrelation in R
Hi, I am trying to learn time series, and I am attending a colleague's course on Econometrics. However, he uses e-views, and I use R. I am trying to reproduce his examples in R, but I am having problems specifying a AR(1) model. Would anyone help me with my code? Thanks in advance! Reproducible code follows: download.file("https://sites.google.com/a/proxima.adm.br/main/ex_32.csv
2007 Aug 28
6
Factor levels
Dear R-users, I have found this not-so-recent post in the archives - http://tolstoy.newcastle.edu.au/R/devel/00a/0291.html - while I was looking for a particular way to reorder factor levels. The question addressed by the author was to know if the read.table function could be modified to order the levels of newly created factors "according to the order that they appear in the data
2012 Apr 29
1
CForest Error Logical Subscript Too Long
Hi, This is my code (my data is attached): library(languageR) library(rms) library(party) OLDDATA <- read.csv("/Users/Abigail/Documents/OldData250412.csv") OLDDATA$YD <- factor(OLDDATA$YD, label=c("Yes", "No"))? OLDDATA$ND <- factor(OLDDATA$ND, label=c("Yes", "No"))? attach(OLDDATA) defaults <- cbind(YD, ND) set.seed(47) data.controls
2018 Mar 05
2
Unclosed parenthesis in grep.Rd
Lines 129-131: \code{grep(value = FALSE)} returns a vector of the indices of the elements of \code{x} that yielded a match (or not, for \code{invert = TRUE}. This will be an integer vector unless the input There should be a closing parenthesis after \code{invert = TRUE}
2018 Mar 05
1
Unclosed parenthesis in grep.Rd
There are probably more unmatched parentheses around: detect <- function(file) { text <- paste(readLines(file), collapse = "") nchar(gsub("[^(]", "", text)) != nchar(gsub("[^)]", "", text)) } docs <- list.files("r-source-trunk/src/library", pattern = "\\.Rd$", full.names =
2009 Aug 01
3
Transparency and trellis device
Dear R-users, I am trying to produce trellis (png, or jpeg) graphs with transparent background, but I cannot manage to make that happen. I tried to play around with themes but to no avail. Any advise on the following example will be greatly appreciated: Thank you Sebastien #### library(lattice) df <- data.frame(a=rep(1:4,4), b=rep(1:4,4), c=rep(1:4,each=4)) settings <- standard.theme()
2009 Nov 30
3
Question about output from optim
Dear R-users, I am trying to port to R something that I wrote in Matlab to perform model parameter optimization using the Nelder-Mead simplex method (fminsearch). I read the help on ?optim (which seems to be the way to go) as well as a bunch of posts on the topic, but I would like to make sure about something before I spend to much time trying to reproduce something that is not possible. The
1997 Sep 05
2
R-beta: help with R simulation
[[this bounced first, because it has 'help' in the Subject line ... -- Martin Maechler ]] I am a complete novice R programmer. (Though I know C quite well) I am trying to write some R code to do the following simulation. There is a 2-frame "movie" of noise and signal dots. the noise dots have random positions in each frame. The signal dots are placed randomly in frame 1,
2015 Aug 14
2
[LLVM RFC] Add llvm.typeid.for intrinsic
This is for BPF output. BPF program output bytes to perf through a tracepoint. For decoding such data, we need a way to describe the format of the buffer. This patch is a try which gives each variable a unique number by introducing a new intrinsic 'llvm.typeid.for'. At the bottom is an example of using that intrinsic and the result of $ clang -target bpf -O2 -c -S ./test_typeid.c
2008 Dec 03
3
Strplit code
Dear R-users, The strsplit function does not exist in S-plus and I would like to use it. How could I reproduce the function in Splus or access to its source code? Thank you in advance, Sebastien
2007 Jun 14
1
Define tick mark width
Hello, Is there a way to define the width of the axis tick marks on traditionnal plots? I did not find anything specific on this topic in the help and par(lwd=...) does not affect the tick marks. I guess that using axes=FALSE and recreating the axis with the axis() command could do the trick but I wonder if there is no easier way. Thanks in advance Sebastien