similar to: Extract Element of String with R's Regex

Displaying 20 results from an estimated 1000 matches similar to: "Extract Element of String with R's Regex"

2008 Aug 05
1
About Creating a List by Parsing Text
Hi all, I have the following data in which I want to parse and store them in a list __DATA__ > print(comp.ll) [1] "\tGene 11340 211952_at RANBP5 k= 1 LL= -970.692 " [2] "\tGene 11340 211952_at RANBP5 k= 2 LL= -965.35 " [3] "\tGene 11340 211952_at RANBP5 k= 3 LL= -963.669 " [4] "\tGene 12682 213301_x_at TRIM24 k= 1 LL= -948.527 "
2008 May 23
2
About Passing Arguments to Function
Hi, Below I have a function mlogl_k, later it's called with "nlm" . __BEGIN__ vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) mlogl_k <- function( k_func, x_func, theta_func, samp) { tot_mll <- 0 for (comp in 1:k_func) { curr_mll <- (- sum(dgamma(samp, shape = x_func, scale=theta_func, log = TRUE))) tot_mll <- tot_mll + curr_mll }
2008 May 08
5
MBOX to Maildir preserving the UIDL (outlook-tested, no redownloading)
TESTED AND RUNNING, MIGRATING from MBOX to MAILDIR, PRESERVE UID and OUTLOOK sees the email as downloaded. I hope this helps a lot of people out there. Feel free to post this somewhere else too. By: Horn Wijaya (hwijaya at nodens.biz) 8th May 2008 I have been searching for weeks for a foolproof method to migrate all my users mbox to maildir/dovecot without having the pain of downloading
2019 Jul 02
1
eliminate a partial argument match warning in R CMD check
Hello, I'm seeing a nuisance warning when I run `R CMD check --as-cran whatever_x.y.z.tar.gz`. I generally work with these options set: options( warnPartialMatchArgs = TRUE, warnPartialMatchAttr = TRUE, warnPartialMatchDollar = TRUE ) And I see this: * checking use of SHLIB_OPENMP_*FLAGS in Makefiles ...Warning in dir("src", patt = "[.]c$") : partial argument
2008 Jul 14
3
Dovecot Crash
Jul 13 08:19:15 hera dovecot: fstat 75 : Value too large for defined data type Jul 13 08:19:18 hera dovecot: fstat 75 : Value too large for defined data type Jul 13 08:19:20 hera dovecot: fstat 75 : Value too large for defined data type Jul 13 08:19:27 hera dovecot: fstat 75 : Value too large for defined data type Jul 13 08:19:27 hera dovecot: fstat 75 : Value too large for defined data type Jul
2008 Oct 07
3
vectorized sub, gsub, grep, etc.
R pattern-matching and replacement functions are vectorized: they can operate on vectors of targets. However, they can only use one pattern and replacement. Here is code to apply a different pattern and replacement for every target. My question: can it be done better? sub2 <- function(pattern, replacement, x) { len <- length(x) if (length(pattern) == 1) pattern <-
2014 Apr 28
2
Re: [supermin] Be smarter about finding suitable kernel images
* Richard W.M. Jones: > On Sat, Apr 26, 2014 at 02:27:07PM +0200, Hilko Bengen wrote: >> --- >> src/kernel.ml | 43 ++++++++++++++++++++++++++++--------------- >> 1 file changed, 28 insertions(+), 15 deletions(-) >> >> diff --git a/src/kernel.ml b/src/kernel.ml >> index ed5aea3..436b1b0 100644 >> --- a/src/kernel.ml >> +++ b/src/kernel.ml
2014 Apr 26
2
[supermin] Be smarter about finding suitable kernel images
--- src/kernel.ml | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/src/kernel.ml b/src/kernel.ml index ed5aea3..436b1b0 100644 --- a/src/kernel.ml +++ b/src/kernel.ml @@ -23,6 +23,19 @@ open Utils open Ext2fs open Fnmatch +let patt_of_cpu host_cpu = + let models = + match host_cpu with + | "mips" |
2017 Sep 20
4
[PATCH 0/4] Replace some uses of the Str module with PCRE.
Str is a pretty ugly regexp module. Let's try to replace it with PCRE. This series of commits goes some small way towards that eventual goal. - - - I wonder if there was a deep reason why we had this? let unix2dos s = String.concat "\r\n" (Str.split_delim (Str.regexp_string "\n") s) I replaced it with what I think should be (nearly) equivalent: let unix2dos s =
2007 Sep 18
10
Routes
hi all, I want to move some routing tasks out of the router and into the controller. The goal is to make Merb feel less like mod_rewrite and give the user more control at the controller. The new Router is simple: it takes the path_info (not the whole request) then outputs a controller class and some parameters from the path matching. The rest of the routing would be done at the controller level.
2017 Sep 22
27
[PATCH v3 00/22] Replace almost all uses of the Str module with PCRE.
v1: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html v2: https://www.redhat.com/archives/libguestfs/2017-September/msg00158.html v3 is almost identical to v2, but I have added 4 extra commits to almost finish the job of replacing Str everywhere possible (note it's not possible to replace Str in common/mlstdutils or the generator because those are pure OCaml). As
2008 Feb 26
2
Combining series of variables using identifier
R users, I have df like this a <- data.frame( indx = 1:20, var1 = rep(c("I20", "I40", "A50", "B60"), each=5), var1_lab= rep(c("cat", "dog", "mouse", "horse"), each=5), var2 = rep(c("B20", "X40", "D50",
2008 May 22
1
Computing Maximum Loglikelihood With "nlm" Problem
Hi, I tried to compute maximum likelihood under gamma distribution, using nlm function. The code is this: __BEGIN__ vsamples<- c(103.9, 88.5, 242.9, 206.6, 175.7, 164.4) mlogl <- function(alpha, x) { if (length(alpha) > 1) stop("alpha must be scalar") if (alpha <= 0) stop("alpha must be positive") return(- sum(dgamma(x, shape = alpha, log = TRUE)))
2008 May 26
1
Joining Histograms Into a Figure
Hi, I have two histograms created separately using the following code. It creates two separate figures. dat <- read.table(file="GDS1096.modelout", head = FALSE ) __BEGIN__ dat <- read.table(file="GDS1096.modelout", head = FALSE ) hist(dat$V2, main="AIC Freq", xlab = "\# Component", breaks = 36, xlim = c(0,max(dat$V2)), col = "dark red",
2008 Jun 17
2
Accessing Max/Min Value of Density Function
Dear all, Currently I have the following output > mydensity <- density(x) > print(mydensity) x y Min. : -92.14 Min. :0.000e+00 1st Qu.: 356.66 1st Qu.:5.530e-09 Median : 805.45 Median :4.681e-05 Mean : 805.45 Mean :5.564e-04 3rd Qu.:1254.24 3rd Qu.:3.370e-04 Max. :1703.04 Max. :5.541e-03 How can I access the Max value of
2006 Apr 13
3
WC3 - please insert CD problem
Hi all, I have trouble with making the symbolic link to the corresponding device node. I have typed sudo In ~/.wine/dosdevices lrwxrwxrwx 1 username d: -> /mnt/cdrom but it gives me this error : prawira@ubuntu:~/Warcraft III$ ln ~/.wine/dosdevices lrwxrwxrwx 1 d: -> /mnt/cdrom bash: /mnt/cdrom: Permission denied prawira@ubuntu:~/Warcraft III$ ln ~/.wine/dosdevices lrwxrwxrwx 1 d:: ->
2012 Aug 01
2
add vectors to multiple objects
Hi everyone, I try to add many vectors (L1,L2,L3....) to many list objects (a.list, b.list....) in a workspace. Somethings like below, but it is not working. Any suggestions will be appreciated. Best, John lf=ls(pattern=".lst")  for (x in listfiles) {     dat=read.delim(x,header=F)     for (i in 1: lf) {     assign(i$add,as.numeric(dat[,3]))   #or i$add=as.numeric(dat[,3]    
2010 Sep 08
2
subbing a string vector for another string vector
I have a data frame with two columns: image pattern 1 http://$IMAGE_ID$ www.url.com/image.jpg 2 $IMAGE_ID$ http://www.blah.com/image.gif ... I want to replace "$IMAGE_ID$" with the corresponding entry in the pattern column such that the result would appear as follows: url http://www.url.com/image.jpg
2008 Jun 11
3
Finding Coordinate of Max/Min Value in a Data Frame
Hi, Suppose I have the following data frame. __BEGIN__ > library(MASS) > data(crabs) > crab.pca <- prcomp(crabs[,4:8],retx=TRUE) > crab.pca$rotation PC1 PC2 PC3 PC4 PC5 FL 0.2889810 0.3232500 -0.5071698 0.7342907 0.1248816 RW 0.1972824 0.8647159 0.4141356 -0.1483092 -0.1408623 CL 0.5993986 -0.1982263 -0.1753299 -0.1435941 -0.7416656 CW
2007 Nov 13
2
cbind function
Hello everyone, I would like to use the "cbind" function to construct a dataset, combining some variable I defined before. The codes are something like var1 <- ... var2 <- ... var2 <- ... ... data <- cbind(var1,var2,var3...) The problem is I would like some flexibity in the data, i.e. the number of the variables are not fixed. Is there a method of combine the uncertain