similar to: R-help: grep in for loop using index - doesn't work

Displaying 20 results from an estimated 10000 matches similar to: "R-help: grep in for loop using index - doesn't work"

2008 Sep 06
1
Help use try function with boot
Hi R users, Is is possible for me to use the try function with boot? I would to do the bootstraping with a nonlinear model(it works well when R < 1000). But it does not work very well (when R is large) thus I try to use "try" to resolve. I put the try function in two cases: case1: put the try in front of the boot > c1.try<-try(boot(c1data, statistic = c1.fun,
2009 Mar 12
1
eps/pdf write help
I am trying to print graphs as pdf''s or eps in a for loop, but I can''t seem to get it right Either it prints only a single eps graph (overwrites) or when I use #pdf(paste(i,".pdf", sep="")) .. it prints all pdf''s but they are empty Can someone suggest which method shud I use for such. Thanks Mohan Code: for(i in 1:19) { query
2010 Nov 09
4
help to add a new column filled with value 1
Dear All, I have a data frame with 5 column and 201 row data. I want to add one more column between column 1 and 2 with value of 1. So the new column has to be the second column filled with 1. Any help will be appreciated. Thanks for your time. Thanks & Rg Mohan L
2010 Oct 01
1
add a new column to data frame
Hi, I am wondering if anyone can propose a simple/best way to do the following: Let's say I have a data frame dat <- cbind(expand.grid(mode=c('right','left'),time=0:3,id=c('p1','p2','p3')),y=c(3,5,rep(4,6),6,2,rep(3,6),4,4,rep(2,6))) dat mode time id y 1 right 0 p1 3 2 left 0 p1 5 3 right 1 p1 4 4 left 1 p1 4 5 right 2
2011 Feb 02
2
Help with one of "those" apply functions
Hello there, I'm still struggling with the *apply commands. I have 5 people with id's from 10 to 14. I have varying amounts (nrep) of repeated outcome (value) measured on them. nrep <- 1:5 id <- rep(c("p1", "p2", "p3", "p4", "p5"), nrep) value <- rnorm(length(id)) I want to create a new vector that contains the sum of the
2003 Oct 13
4
help with gsub and grep functions
Hi all, Let Names a vector of chatacters. For example, > Names [1] "g 604 be-0 -p1 (602 matches)" "g 606 Phli-0 -p2 (517 matches)" [3] "g 608 alu-0 (659 matches)" I try to use gsub or grep functions for two problems : 1. First, I would like to delete all the characters between parentheses. [1] "g 604 be-0 -p1" "g 606 be-0 -p2" [3] "g
2006 Jun 19
2
frechet distance
Hi, is there any package (or source code snippet) that will evaluate the Frechet distance for curves represented as sets of points? Searching around only threw up references to a Frechet distribution. Thanks, ------------------------------------------------------------------- Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9
2004 Dec 01
1
tuning SVM's
Hi I am doing this sort of thing: POLY: > > obj = best.tune(svm, similarity ~., data = training, kernel = "polynomial") > summary(obj) Call: best.tune(svm, similarity ~ ., data = training, kernel = "polynomial") Parameters: SVM-Type: eps-regression SVM-Kernel: polynomial cost: 1 degree: 3 gamma: 0.04545455 coef.0: 0
2008 Aug 21
5
psychometric functions
Hi, I want to fit some psychophysical data with cumulative gaussians. There is quite a convenient toolbox for matlab called 'psignifit' (formerly known as 'psychofit'). It allows the lower bound of the sigmoid to vary slightly from zero, aswell as the upper bound to vary from one. with these two free parameters, the fitted function is less sensitive to noisy data and outliers.
2005 Apr 11
1
glm family=binomial logistic sigmoid curve problem
I'm trying to plot an extrapolated logistic sigmoid curve using glm(..., family=binomial) as follows, but neither the fitted() points or the predict()ed curve are plotting correctly: > year <- c(2003+(6/12), 2004+(2/12), 2004+(10/12), 2005+(4/12)) > percent <- c(0.31, 0.43, 0.47, 0.50) > plot(year, percent, xlim=c(2003, 2007), ylim=c(0, 1)) > lm <- lm(percent ~ year)
2009 Aug 05
2
labeling in qplot
HI am plotting different density plots in one graph each with a different color. And i want to add labels to plot mentioning which color belongs to which data series. p2 <- qplot(corArms, data = data1, geom = "density", adjust=0.4, main="Arms Correlation All") + layer(data=data2, geom="density", adjust=0.4, color=I(2)) + layer(data=data3,
2010 Nov 09
2
help to merge two data frame if name matches
Dear All, I have two data like this : $cat main.csv name,id,memory,storage mohan,1,100.20,1.10 ram,1,200,100 kumar,1,400,50 xxx,1,100,40 aaa,1,800,45 mount,1,200,80 > main <- read.csv(file='main.csv',sep=',' , header=TRUE) > main name id memory storage 1 mohan 1 100.2 10 2 ram 1 200.0 100 3 kumar 1 400.0 50 4 xxx 1
2013 Aug 27
6
Scale of axis for two data sets
Hi, Kbytes RSS rNo 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1460168 1443084 plot(data$rNo,data$RSS,pch=0,type="b",col=36,axes=FALSE, ylab="", xlab="",las=2,lwd=2.5) title(" PID -
2013 Nov 01
2
Replace element with pattern
Hi, I have a data frame with one column and several rows of the form. "Peak Usage : init:2359296, used:15859328, committed:15892480, max:50331648Current Usage : init:2359296, used:15857920, committed:15892480, max:50331648|-------------------|" I tested the regex Current.*?[\|] in an online tester which greedily matches upto the first 'pipe' character Current
2005 May 17
4
HOW TO Enable IPSec for FreeBSD.......???
Hi, I have tried to enable IPSec support for my FreeBSD( 4.11-RELEASE) system. First, I copied the generic kernel configuration file to a file I called MYKERNEL: #cp /usr/src/sys/i386/conf/GENERIC /usr/src/sys/i386/conf/MYKERNEL Then, I added the following three lines to the options section of /usr/src/sys/i386/conf/MYKERNEL: options IPSEC options IPSEC_ESP options
2013 Mar 14
2
Grep with wildcards across multiple columns
I have a fairly large data set with six variables set up like the following dummy: # Create fake data df <- data.frame(code = c(rep(1001, 8), rep(1002, 8)), year = rep(c(rep(2011, 4), rep(2012, 4)), 2), fund = rep(c("10E", "10E", "10E", "27E"), 4), func = rep(c("110000",
2010 Nov 07
3
help to sum up data frame
Dear All, I have a data frame like this: name ip Bsent Breceived a 1 0.00 0.00 a 2 1.43 19.83 a 1 0.00 0.00 a 2 1.00 1.00 b 1 0.00 2.00 b 3 0.00 2.00 b 2 2.00 0.00 b 2 2.00 0.00 b 1 24.40 22.72 c
2009 Apr 26
1
Stochastic Gradient Ascent for logistic regression
Hi. guys, I am trying to write my own Stochastic Gradient Ascent for logistic regression in R. But it seems that I am having convergence problem. Am I doing anything wrong, or just the data is off? Here is my code in R - lbw <- read.table("http://www.biostat.jhsph.edu/~ririzarr/Teaching/754/lbw.dat" , header=TRUE) attach(lbw) lbw[1:2,] low age lwt race smoke ptl ht ui ftv
2009 Mar 16
2
plot lines at 0,0 axis
Hii I am trying to plot lines at (0,0) axis where my scatterplot goes between positive n negative values for x and y axis i can plot point using points(0,0) but if i want to draw lines along it, can't seem to get it right Mohan
2007 Jul 26
5
ROC curve in R
Hi, I need to build ROC curve in R, can you please provide data steps / code or guide me through it. Thanks and Regards Rithesh M Mohan [[alternative HTML version deleted]]