Re: [R] output without quotes

2010-07-09 Thread AC Del Re
Wonderful, David! Thank you much for your help on this. AC On Fri, Jul 9, 2010 at 6:49 PM, David Winsemius wrote: > > On Jul 9, 2010, at 7:19 PM, Erik Iverson wrote: > > AC Del Re wrote: >> >>> Hi David, >>> I don't have the function in order yet but the names will be going into >>> the >>> for

Re: [R] interpretation of svm models with the e1071 package

2010-07-09 Thread Noah Silverman
Steve, Couldn't he also just use the decision.value property to see the equivilent of t(x) %*% b for each row? -N On 7/9/10 7:11 PM, Steve Lianoglou wrote: Hi, On Fri, Jul 9, 2010 at 12:15 PM, manuel.martin wrote: Dear all, after having calibrated a svm model through the svm() comma

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Ravi Varadhan
Hi, The absolute function stopping criterion is not meant for any positive objective function. It is meant for functions whose minimum is 0. Here is what David Gay's documentation from PORT says: "6 - absolute function convergence: |f (x)| < V(AFCTOL) = V(31). This test is only of interest

Re: [R] Compress string memCompress/Decompress

2010-07-09 Thread Erik Wright
Hi Matt, This works great, thanks! At first I got an error message saying BLOB is not implemented in RSQLite. When I updated to the latest version it worked. Is there any reason the string needs to be stored as type BLOB? It seems to work the same when I swap "BLOB" with "TEXT" in the CREATE

Re: [R] interpretation of svm models with the e1071 package

2010-07-09 Thread Steve Lianoglou
Hi, On Fri, Jul 9, 2010 at 12:15 PM, manuel.martin wrote: > Dear all, > > after having calibrated a svm model through the svm() command of the e1071 > package, is there a way to > i) represent the modeled relationships between the y and X variables > (response variable vs. predictors)? Can you e

Re: [R] Function similar to combine.levels in Hmisc package

2010-07-09 Thread Frank E Harrell Jr
On 07/09/2010 05:33 PM, Saeed Abu Nimeh wrote: Is there a function similar to combine.levels ( in the Hmisc package) that combines the levels of factors, but not based on their frequency. Alternatively, I am looking into using the significance of the dummy variables of factors based on their Pr(>

Re: [R] String truncate

2010-07-09 Thread jd6688
Thanks so lot -- View this message in context: http://r.789695.n4.nabble.com/String-truncate-tp2284045p2284069.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] String truncate

2010-07-09 Thread jd6688
Thanks this works On Fri, Jul 9, 2010 at 4:32 PM, Wu Gong [via R] < ml-node+2284062-824667456-312...@n4.nabble.com > wrote: > Do you mean substring? > > sub(".txt","", "mytest.txt") > A R learner. > > > -- > View message @ > http://r.789695.n4.nabble.com/String-trunc

[R] String truncate

2010-07-09 Thread jd6688
one string named as: mytest.txt how can I remove the .txt and return the mytest only. i tried split substr, and grep didn't work it out, Thanks so lot -- View this message in context: http://r.789695.n4.nabble.com/String-truncate-tp2284045p2284045.html Sent from the R help mailing list archi

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Matthew Killeya
And further to those two: nlminb( obj = function(x) 2*(x+3), start=-2, lower=-Inf, upper=Inf ) On 9 July 2010 23:09, Matthew Killeya wrote: > Yes clearly a bug... there are numerous variations ... problem seems to be > for a linear function whenever the first function valuation is 1. > > e.g.

Re: [R] stl function

2010-07-09 Thread kateg
Hi there, I tried the code that was sent. Thanks a lot. It doesn't seem to work. Here is what I'm working with... inc<-ts(incdat[,2], start=1968.000, freq=12) par(mfrow=c(1,2)) plot(stl(log(inc), s.window="periodic")) -- View this message in context: http://r.789695.n4.nabble.com/stl-fun

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Matthew Killeya
Yes clearly a bug... there are numerous variations ... problem seems to be for a linear function whenever the first function valuation is 1. e.g. two more examples: nlminb( obj = function(x) x+1, start=0, lower=-Inf, upper=Inf ) nlminb( obj = function(x) x+2, start=-1, lower=-Inf, upper=Inf ) (

[R] a question about using the sensitivity package

2010-07-09 Thread Jiang, Yueyang
Hi, I'm using the sensitivity package to calculate the sobol indices. The case is that I have 13 parameter and each one has 1000 samples and my model result is a vector having 1000 values (based on the 1000 sample simulation). I just wonder how to use the sobol function, the pdf looks straightfo

Re: [R] R crashes with large vectors

2010-07-09 Thread Ben Bolker
Jeremie Smaga 4ecap.com> writes: > > Good afternoon, > > I have been experiencing a lot of crashes working with large vectors in R. > > Specifically, I am using XTS of length of minimum 120k elements. > > My problem is that I cannot display the vector (otherwise R crashes), I > cannot plot it

Re: [R] apply is slower than for loop?

2010-07-09 Thread Gene Leynes
I should add that I'm using R 2.10.1 on a Windows 7 machine, thanks! On Fri, Jul 9, 2010 at 3:11 PM, Gene Leynes > wrote: > I thought the "apply" functions are faster than for loops, but my most > recent test shows that apply actually takes a significantly longer than a > for loop. Am I missing

Re: [R] output without quotes

2010-07-09 Thread David Winsemius
On Jul 9, 2010, at 7:19 PM, Erik Iverson wrote: AC Del Re wrote: Hi David, I don't have the function in order yet but the names will be going into the formula, e.g., in body of function: { ...etc out <- lm( y ~ TEMP) # where TEMP = mod1+mod2 (from previous post) return(out) } So

Re: [R] output without quotes

2010-07-09 Thread Erik Iverson
AC Del Re wrote: Hi David, I don't have the function in order yet but the names will be going into the formula, e.g., in body of function: { ...etc out <- lm( y ~ TEMP) # where TEMP = mod1+mod2 (from previous post) return(out) } So why not just pass the formula to the function?

Re: [R] output without quotes

2010-07-09 Thread AC Del Re
Hi David, I don't have the function in order yet but the names will be going into the formula, e.g., in body of function: { ...etc out <- lm( y ~ TEMP) # where TEMP = mod1+mod2 (from previous post) return(out) } Thanks, AC On Fri, Jul 9, 2010 at 3:20 PM, David Winsemius wrote:

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Duncan Murdoch
On 09/07/2010 6:09 PM, Matthew Killeya wrote: Yes clearly a bug... there are numerous variations ... problem seems to be for a linear function whenever the first function valuation is 1. Not at all. You can get the same problem on a quadratic that happens to have a zero at an inconvenient

[R] Function similar to combine.levels in Hmisc package

2010-07-09 Thread Saeed Abu Nimeh
Is there a function similar to combine.levels ( in the Hmisc package) that combines the levels of factors, but not based on their frequency. Alternatively, I am looking into using the significance of the dummy variables of factors based on their Pr(>|t|) value using the linear model, then deleting

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Peter Ehlers
Actually, it looks like any value other than 1.0 (and in (lower, upper)) for start will work. -Peter Ehlers On 2010-07-09 14:45, Ravi Varadhan wrote: Setting abs.tol = 0 works! This turns-off the absolute function convergence criterion. nlminb( objective=function(x) x, start=1, lower=-2,

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Ravi Varadhan
Let me clarify my statement in the previous email: by absolute criterion, I meant |f(x_n)| < tol. It is ok to use: |f(x_{n+1}) - f(x_n)| < abs.tol Although I prefer the hybrid condition in my previous email. Ravi. -Original Message- From: Ravi Varadhan [mailto:rvarad...@jhmi.edu] S

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Ravi Varadhan
An absolute criterion should NEVER be used. For the situation where f(x*) = 0, instead of the PORT criterion (6) we should use the following: |f(x_{n+1}) - f(x_n)| < (rel.tol * |f(x_n)| + abs.tol) Ravi. -Original Message- From: Ravi Varadhan [mailto:rvarad...@jhmi.edu] Sent: Friday, J

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Ravi Varadhan
Setting abs.tol = 0 works! This turns-off the absolute function convergence criterion. > nlminb( objective=function(x) x, start=1, lower=-2, upper=2, control=list(abs.tol=0)) $par [1] -2 $objective [1] -2 $convergence [1] 0 $message [1] "both X-convergence and relative convergence (5)" $iter

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Ravi Varadhan
Duncan, `nlminb' is not intended for non-negative functions only. There is indeed something strange happening in the algorithm! start <- 1.0 # converges to wrong minimum startp <- 1.0 + .Machine$double.eps # correct startm <- 1.0 - .Machine$double.eps # correct > nlminb( objective=obj, start

Re: [R] String truncate

2010-07-09 Thread Wu Gong
Do you mean substring? sub(".txt","", "mytest.txt") - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/String-truncate-tp2284045p2284062.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

Re: [R] nls error regarding numerics vs logicals

2010-07-09 Thread Peter Ehlers
On 2010-07-09 13:29, Duncan Murdoch wrote: On 09/07/2010 2:36 PM, Jim Bouldin wrote: > 1. The expression you gave us is clearly not the one that produced the > error: it involved "ring.area" and "ba.beg". > > 2. You don't tell us what x and y are, so we can't reproduce anything. Sorry, I guess

Re: [R] output without quotes

2010-07-09 Thread David Winsemius
On Jul 9, 2010, at 3:51 PM, AC Del Re wrote: Hi All, I am interested in printing column names without quotes and am struggling to do it properly. The tough part is that I am interested in using these column names for a function within a function (e.g., lm() within a wrapper function). The

Re: [R] Compress string memCompress/Decompress

2010-07-09 Thread Matt Shotwell
Erik, Can you store the data as a blob? For example: > #create string, compress with gzip, convert to SQLite blob string > string <- "gzip this string, store as blob in SQLite database" > string.gz <- memCompress(string, type="gzip") > string.sqlite <- paste("x'",paste(string.gz,collapse=""),"'"

Re: [R] apply is slower than for loop?

2010-07-09 Thread Duncan Murdoch
On 09/07/2010 4:11 PM, Gene Leynes wrote: I thought the "apply" functions are faster than for loops, but my most recent test shows that apply actually takes a significantly longer than a for loop. Am I missing something? Probably not. apply() needs to figure out the shape of the results it

Re: [R] S: Book for time series analysis with R

2010-07-09 Thread David Winsemius
On Jul 9, 2010, at 3:37 PM, soeren.vo...@eawag.ch wrote: Hello Could you recommend a printed/electronic book that teaches time series analysis (using R) for students? I am searching for something similar to the MASS book, with a level lower but close, for TSA. Easy examples would be fine

[R] apply is slower than for loop?

2010-07-09 Thread Gene Leynes
I thought the "apply" functions are faster than for loops, but my most recent test shows that apply actually takes a significantly longer than a for loop. Am I missing something? It doesn't matter much if I do column wise calculations rather than row wise ## Example of how apply is SLOWER than f

[R] output without quotes

2010-07-09 Thread AC Del Re
Hi All, I am interested in printing column names without quotes and am struggling to do it properly. The tough part is that I am interested in using these column names for a function within a function (e.g., lm() within a wrapper function). Therefore, cat() doesnt seem appropriate and print() is n

Re: [R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Duncan Murdoch
On 09/07/2010 10:37 AM, Matthew Killeya wrote: nlminb( obj = function(x) x, start=1, lower=-Inf, upper=Inf ) If you read the PORT documentation carefully, you'll see that their convergence criteria are aimed at minimizing positive functions. (They never state this explicitly, as far as I

[R] S: Book for time series analysis with R

2010-07-09 Thread soeren . vogel
Hello Could you recommend a printed/electronic book that teaches time series analysis (using R) for students? I am searching for something similar to the MASS book, with a level lower but close, for TSA. Easy examples would be fine to understand deeper statistical procedures. Functions, results

Re: [R] nls error regarding numerics vs logicals

2010-07-09 Thread Duncan Murdoch
On 09/07/2010 2:36 PM, Jim Bouldin wrote: > 1. The expression you gave us is clearly not the one that produced the > error: it involved "ring.area" and "ba.beg". > > 2. You don't tell us what x and y are, so we can't reproduce anything. Sorry, I guess that was unclear. I changed the respon

Re: [R] hide scatter points

2010-07-09 Thread Roy Mendelssohn
Try changing the plot call to: > plot(x2, y2, type ="n") look at: ?plot -Roy On Jul 9, 2010, at 12:20 PM, Marlin Keith Cox wrote: > I need to hide scatter points and just leave the linear regression > line. I have tried to color the points "white", but that does not > work. > > A working e

Re: [R] hide scatter points

2010-07-09 Thread Sarah Goslee
plot(x2, y2, pch=16, type="n") On Fri, Jul 9, 2010 at 3:20 PM, Marlin Keith Cox wrote: > I need to hide scatter points and just leave the linear regression > line.  I have tried to color the points "white", but that does not > work. > > A working example, I need the green plotted points to be tra

[R] hide scatter points

2010-07-09 Thread Marlin Keith Cox
I need to hide scatter points and just leave the linear regression line. I have tried to color the points "white", but that does not work. A working example, I need the green plotted points to be transparent or hidden. x2 <- seq(1,200,.5) y2 <- seq(5,204,.5) plot(x2, y2, pch=16, col="green") mod

Re: [R] Mover Stayer Models

2010-07-09 Thread Ingmar Visser
depmixS4 can fit such models as a constrained latent markov mdoel, best, Ingmar On Fri, Jul 9, 2010 at 7:52 PM, Katherine Sanders < sanders@buckeyemail.osu.edu> wrote: > Does anyone know how to program mover stayer models in R? They are a type > of Markov chain model where there is a group o

Re: [R] Ctree Question

2010-07-09 Thread Achim Zeileis
On Fri, 9 Jul 2010, steve_fried...@nps.gov wrote: Hello, I've been using ctree and have developed a 55 node - 28 terminal solution. As can be imagined, the plot is difficult to travel down each of the major branches. I've read the help files for ctree I saw where terminal nodes can be color c

Re: [R] stl function

2010-07-09 Thread Achim Zeileis
On Fri, 9 Jul 2010, kateg wrote: Hi all, I'm working on decomposition and comparison of several time series. I'm interested in extracting the trend components for each time series using the stl function and overlaying them on one another. I'm not sure how to plot the trend function alone and

Re: [R] select columns from dataframe

2010-07-09 Thread Erik Iverson
Jonathan Flowers wrote: Hi, I would like to extract columns from a dataframe using a vector of desired column names. The following working example uses the select argument in the subset function to accomplish what I am trying to do. Is there a better solution? This is very much "Introducti

Re: [R] nls error regarding numerics vs logicals

2010-07-09 Thread Jim Bouldin
> 1. The expression you gave us is clearly not the one that produced the > error: it involved "ring.area" and "ba.beg". > > 2. You don't tell us what x and y are, so we can't reproduce anything. Sorry, I guess that was unclear. I changed the response and independent variable names to y and

Re: [R] eval and assign in loop problem

2010-07-09 Thread Erik Iverson
for (i in 0:3) { r = runif(1) assign(paste('b',i,sep=''),r) } for (i in 1:4) { assign(paste('b',i,sep=''),eval(parse(text=paste('b',i-1,sep='' } First, b1 is set to b0 Then, b2 is set to b1 (which was just set to b0) Then, b3 is set

Re: [R] select columns from vector of column names

2010-07-09 Thread MacQueen, Don
How about data[ , colnames] Or data[ , colnames[1]] data[ , colnames[2]] -Don On 7/9/10 11:27 AM, "Jonathan Flowers" wrote: > Hi > > I want to extract columns from a data frame using a vector with the desired > column names. > > This short example uses the select argument in the subse

[R] Mover Stayer Models

2010-07-09 Thread Katherine Sanders
Does anyone know how to program mover stayer models in R? They are a type of Markov chain model where there is a group of people who stays in the same place, a group who always moves, and a group who does both. Thanks. Leanne Sanders sanders@osu.edu [[alternative HTML version dele

[R] stl function

2010-07-09 Thread kateg
Hi all, I'm working on decomposition and comparison of several time series. I'm interested in extracting the trend components for each time series using the stl function and overlaying them on one another. I'm not sure how to plot the trend function alone and to do the overlay using some kind

[R] Help finding valid permutations

2010-07-09 Thread Michael D
So I have an array A of length n with multiple attributes and for a selected attribute y I need to list all valid permutations where a valid permutation is of the form: A[1,y] != A[n,y] A[i,y] != A[i+1,y] I've tried using the 'combinat' package, but with the vector lengths I'm using the permn func

[R] Compress string memCompress/Decompress

2010-07-09 Thread Erik Wright
Hello, I would like to compress a long string (character vector), store the compressed string in the text field of a SQLite database (using RSQLite), and then load the text back into memory and decompress it back into the the original string. My character vector can be compressed considerably

[R] syntax for highlighting table rows and columns using R plugin for spss

2010-07-09 Thread Anderson, Chris
I am using the R plug-in for spss 18, and would like to know if there is any R code that will highlight and bold rows (particularly the "Totals" row) within an spss table. The current option that spss has is to use a python plug-in which doesn't seem to work on my windows 7 machine. Chris Ande

[R] July BaselR Meeting

2010-07-09 Thread Sarah Lewis
BaselR meeting July 2010 Thank you to everyone who supported our inaugural BaselR meeting on April 28th; we were fortunate to have three excellent presentations which prompted lively discussion - our thanks go to Andreas Krause, Yann Abraham and Charles Roosen for their presentations, details o

[R] eval and assign in loop problem

2010-07-09 Thread S.Nicholas
deaR useRs, I am trying to assign different values to different objects in a for loop. The following is a toy example of the part that has been giving me a hard time. The first "for loop" generates four objects, b0, b1, b2, b3 with random numbers. And, the second "for loop" is equivalent to b1 =

Re: [R] split with list

2010-07-09 Thread Ista Zahn
"n.via...@libero.it" writes: Hi, > Dear List I would like to ask you something concenting a better print of the > R output: > I have a bit data frame which has the following structure: > CFISCALE RAGSOCBANNO VAR1VAR2. > 9853312 a

[R] Not nice behaviour of nlminb (windows 32 bit, version 2.11.1)

2010-07-09 Thread Matthew Killeya
nlminb( obj = function(x) x, start=1, lower=-Inf, upper=Inf ) $par [1] 0 $objective [1] 0 $convergence [1] 0 $message [1] "absolute function convergence (6)" $iterations [1] 1 $evaluations function gradient 22 [[alternative HTML version deleted]] _

Re: [R] select columns from vector of column names

2010-07-09 Thread Horace Tso
How about data[,colnames(data)%in%colnames] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Flowers Sent: Friday, July 09, 2010 11:27 AM To: r-help@r-project.org Subject: [R] select columns from vector of column names H

Re: [R] Ctree Question

2010-07-09 Thread Horace Tso
Steve, I'm not sure if your task could be accomplished with a ready-made function in party. But, if you could manage to convert your tree structure to a dendrogram, then it's straightforward using dendrapply. In fact, there is an example in dendrapply help page showing how leaves are colored.

[R] select columns from dataframe

2010-07-09 Thread Jonathan Flowers
Hi, I would like to extract columns from a dataframe using a vector of desired column names. The following working example uses the select argument in the subset function to accomplish what I am trying to do. Is there a better solution? Thanks. #my data data <- data.frame("col1"=c(1,2,3),"col2

Re: [R] Calling Gnuplot from R

2010-07-09 Thread Tal Galili
Dear Greg, I keep on being amazed at the abundance of functions you have packed into the TeachingDemos package - thank you! Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com

[R] select columns from vector of column names

2010-07-09 Thread Jonathan Flowers
Hi I want to extract columns from a data frame using a vector with the desired column names. This short example uses the select argument in the subset function to accomplish what I am trying to do. Is there a better solution? #names of desired columns colnames <- c("col1","col3") #my data data

Re: [R] nls error regarding numerics vs logicals

2010-07-09 Thread Duncan Murdoch
On 09/07/2010 1:51 PM, Jim Bouldin wrote: I am trying to perform an nls for a valid negative exponential function: zz=nls(y~constant+a.est*2.7183^(b.est*x),start=list(constant=4.0,a.est=-4,b.est = -.005),trace=T) and am getting a number of different error messages, the most problematic of whic

Re: [R] R crashes with large vectors

2010-07-09 Thread Tengfei Yin
Hi Jeremie, Maybe you can take a look at the bigmemory package. If you have multi core or have access to clusters, you may want to use any parallel computing strategy. For plotting of large data, if you are using basic R graphics, first try to use "line" instead of using 'point', if this still

[R] nls error regarding numerics vs logicals

2010-07-09 Thread Jim Bouldin
I am trying to perform an nls for a valid negative exponential function: zz=nls(y~constant+a.est*2.7183^(b.est*x),start=list(constant=4.0,a.est=-4,b.est = -.005),trace=T) and am getting a number of different error messages, the most problematic of which is "Error in nls(ring.area ~ constant + a

Re: [R] how to plot two histograms overlapped in the same planecoordinate

2010-07-09 Thread Bert Gunter
Don't do this. The overlapping will confuse. Plot them in a lattice display with one group above the other on the same horizontal scale. See ?histogram. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-proj

Re: [R] Plotting text in existing plot?

2010-07-09 Thread Greg Snow
Others pointed you to the text function for the base graphics system. But if what you want to do is use text, but have a simple way of specifying the center of the plot without computing the user coordinates by hand of the center, then look at the grconvertX and grconvertY functions. -- Grego

[R] Ctree Question

2010-07-09 Thread Steve_Friedman
Hello, I've been using ctree and have developed a 55 node - 28 terminal solution. As can be imagined, the plot is difficult to travel down each of the major branches. I've read the help files for ctree I saw where terminal nodes can be color coded. plot(airct, type = "simple") > plot(airct, te

Re: [R] Calling Gnuplot from R

2010-07-09 Thread Greg Snow
There is a basic interface between R and gnuplot in the TeachingDemos package, see ?gp.open Not much interest has been shown in this, so it is still pretty alpha level, but you can send your R data to gnuplot and have it create a basic plot. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Cen

Re: [R] Query about using timestamps returned by SQL as 'factor' forsplit

2010-07-09 Thread Matthew Dowle
Hi Ted, Well since you mentioned data.table (!) ... If risk_input is a data.table consisting of 3 columns (m_id, sale_date, return_date) where the dates are of class IDate (recently added to data.table by Tom) then try : risk_input[, fitdistr(return_date-sale_date,"normal"), by=list(m_id, y

Re: [R] how to plot two histograms overlapped in the same plane coordinate

2010-07-09 Thread Barry Rowlingson
On Fri, Jul 9, 2010 at 2:29 PM, Mao Jianfeng wrote: > Dear R-help listers, > > I am new. I just want to get helps on how to plot two histograms > overlapped in the same plane coordinate. What I did is very ugly. > Could you please help me to improve it? I want to got a plot with semi- > transparen

Re: [R] how to plot two histograms overlapped in the same plane coordinate

2010-07-09 Thread Frank E Harrell Jr
Empirical CDFs are much better for this purpose, and allow superpositioning (see e.g. the Ecdf function in the Hmisc package). Otherwise look at histbackback in Hmisc. Frank On 07/09/2010 11:40 AM, Andrew Miles wrote: I'm not sure what you are trying to do. Do you want one histogram for mal

Re: [R] how to plot two histograms overlapped in the same plane coordinate

2010-07-09 Thread Andrew Miles
I'm not sure what you are trying to do. Do you want one histogram for males and one for females on the same graph? If so, the simplest way to put two histograms together is to simply use the add parameter: age.males=age[which(sex=="M")] age.females=age[which(sex=="F")] hist(age.males, co

Re: [R] how can achive step by step execution of the script

2010-07-09 Thread Bert Gunter
No - devAskNewPage is not what the OP asked for. 1. The following are, but probably only work when R is in interactive mode (?interactive), e.g. in the GUI: 2. ?winDialog ?file.choose ?choose.files ?select.list ?readline and friends and for keyboard: ?getGraphicsEvent Bert Gunter Genente

[R] interpretation of svm models with the e1071 package

2010-07-09 Thread manuel.martin
Dear all, after having calibrated a svm model through the svm() command of the e1071 package, is there a way to i) represent the modeled relationships between the y and X variables (response variable vs. predictors)? ii) rank the influence of the predictors used in the model? Right now I am m

Re: [R] How can i draw a graph with high and low data points

2010-07-09 Thread Tal Galili
Hi Nathaniel , Could you give us a simple example of your data using the ?dput Function? Basically you might want to draw the axis yourself, and connect the lines is possible through using points(..., type = "l") But I'd rather try and answer this with simple example data to be sure I understand

Re: [R] Plotting text in existing plot?

2010-07-09 Thread Tal Galili
Possible fortune. :) Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---

Re: [R] how can achive step by step execution of the script

2010-07-09 Thread Allan Engelhardt
Sounds like you want devAskNewPage(TRUE) or the related options("device.ask.default"). See help("devAskNewPage", package="grDevices"). Hope this helps. Allan On 09/07/10 13:54, vijaysheegi wrote: Hi R Experts, I have certain code ,i want to achive interactive execution . For ex: 1. as part

Re: [R] Data Frame Manipulation using function

2010-07-09 Thread David Winsemius
Really? I don't usually think of Vectorize as a performance enhancement, probably because my use of with a complex function then gets applied to 4.5 million records. I need to go out, get a cup of coffee, and leave it alone for about half an hour. I tried recently to figure out how I can d

Re: [R] Plotting text in existing plot?

2010-07-09 Thread Bert Gunter
Original poster wanted a simple way to do it, but when R has three graphics systems, four OO systems, and a zillion helpful people there's never a simple way :) -- Rather, I'd say it has a zillion simple ways. :) Bert Barry -- blog: http://geospaced.blogspot.com/ web: http://www.maths.la

[R] print.xtable suppress my row.names

2010-07-09 Thread n.via...@libero.it
Dear list, someone knows why the print.xtable doesnt print row.names? I dident do anything with the options.may depends on the size of my table??? This is my code: \documentclass[a4paper]{article} \title{SCHEMA DI BILANCIO PER SINGOLE AZIENDE} \begin{document} \maketitle \hline <>= library(xt

Re: [R] Function on columns of a dataframe

2010-07-09 Thread Eik Vettorazzi
just to satisfy my curiousity, aggregate(bla, list(bla$cat), max) works for me and resulted in Group.1 x catv1v2v3v4 1cat1 5 cat1 0.6337076 0.2887081 0.3629962 0.5328683 2cat2 10 cat2 0.5519426 0.6076447 0.4593770 0.9632341 3cat3 11 cat3 0.6094089

Re: [R] random sample from arrays

2010-07-09 Thread Joris Meys
Could you elaborate? Both x <- 1:4 set <- matrix(nrow = 50, ncol = 11) for(i in c(1:11)){ set[,i] <-sample(x,50) print(c(i,"->", set), quote = FALSE) } and x <- 1:4 set <- matrix(nrow = 50, ncol = 11) for(i in c(1:50)){ set[i,] <-sample(x,11) print(c(i,"->", set)

Re: [R] Data Frame Manipulation using function

2010-07-09 Thread harsh yadav
Hi, Thanks a lot. The Vectorize method worked and its much faster than looping through the data frame. Regards, Harsh Yadav On Thu, Jul 8, 2010 at 11:06 PM, David Winsemius wrote: > > On Jul 8, 2010, at 10:33 PM, Erik Iverson wrote: > > >> I have a data frame: >>> id url >>> urlType >>

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-09 Thread Dimitri Liakhovitski
Wow, Gabor - that's amazing - thank you so much! Dimitri On Fri, Jul 9, 2010 at 10:22 AM, Gabor Grothendieck wrote: > On Fri, Jul 9, 2010 at 9:35 AM, Dimitri Liakhovitski > wrote: >> Hello! >> >> Any hint would be greatly appreciated. >> I have a data frame that contains (a) monthly dates and (b

[R] print.trellis draw.in - plaintext (gmail mishap)

2010-07-09 Thread Mark Connolly
I am attempting to plot a trellis object on a grid. vplayout = viewport(layout.pos.row=x, layout.pos.col=y) grid.newpage() pushViewport(viewport(layout=grid.layout(2,2))) g1 = ggplot() ... g2 = ggplot() ... g3 = ggplot() ... p = xyplot() ... # works as expected print(g1, vp=vplayout(1,1)) print

Re: [R] Function on columns of a dataframe

2010-07-09 Thread David Winsemius
On Jul 9, 2010, at 10:26 AM, Eik Vettorazzi wrote: you are right. But maybe "aggregate" is close to the desired result? aggregate(bla, list(bla$cat), max) Right. I couldn't get it to work until I removed the first two columns: aggregate(bla[,-(1:2)], list(bla$cat), max) Then I got pretty m

Re: [R] strange floor rounding

2010-07-09 Thread Duncan Murdoch
On 09/07/2010 10:27 AM, Trafim Vanishek wrote: Thanks everybody for referring me to FAQ 7.31 but I don't see how to solve it. I am giving a concrete number and I need to get 58 not 57. Seems, there is no way? You aren't giving a "concrete number". You're giving a string of three characters,

Re: [R] strange floor rounding

2010-07-09 Thread Peter Ehlers
On 2010-07-09 8:27, Trafim Vanishek wrote: Thanks everybody for referring me to FAQ 7.31 but I don't see how to solve it. I am giving a concrete number and I need to get 58 not 57. Seems, there is no way? Sure there is: round(100*0.58). -Peter Ehlers On Fri, Jul 9, 2010 at 4:05 PM, David

Re: [R] Current script name from R

2010-07-09 Thread Allan Engelhardt
On 09/07/10 12:18, Ralf B wrote: I am using RGUI, the command line or the StatET Eclipse environment. Should this not all be the same? No, there is no particular reason why they should. Allan Ralf On Fri, Jul 9, 2010 at 7:11 AM, Allan Engelhardt wrote: I'm assuming you are using

Re: [R] strange floor rounding

2010-07-09 Thread David Winsemius
On Jul 9, 2010, at 10:27 AM, Trafim Vanishek wrote: Thanks everybody for referring me to FAQ 7.31 but I don't see how to solve it. I am giving a concrete number and I need to get 58 not 57. Seems, there is no way? Building on an example on the help page for as.integer, this seems to be

Re: [R] installing packages over ssh without X forwarding

2010-07-09 Thread Duncan Murdoch
On 09/07/2010 7:37 AM, p...@orbit.umbr.cas.cz wrote: Hi, Is it possible to install packages without the testing if installed package can be loaded? I need to install bunch of packages on multiple computers over ssh. Some packages witch interact with X11 display cannot be installed in this way. fo

[R] print.trellis draw.in

2010-07-09 Thread Mark Connolly
I am attempting to plot a trellis object on a grid. vplayout = viewport(layout.pos.row=x, layout.pos.col=y) grid.newpage() pushViewport(viewport(layout=grid.layout(2,2))) g1 = ggplot() ... g2 = ggplot() ... g3 = ggplot() ... p = xyplot() ... # works as expected print(g1, vp=vplayout(1,1)) print

Re: [R] strange floor rounding

2010-07-09 Thread Trafim Vanishek
Thanks everybody for referring me to FAQ 7.31 but I don't see how to solve it. I am giving a concrete number and I need to get 58 not 57. Seems, there is no way? On Fri, Jul 9, 2010 at 4:05 PM, David Winsemius wrote: > > On Jul 9, 2010, at 9:46 AM, Trafim Vanishek wrote: > > Dear all, >> >> migh

Re: [R] Function on columns of a dataframe

2010-07-09 Thread Eik Vettorazzi
you are right. But maybe "aggregate" is close to the desired result? aggregate(bla, list(bla$cat), max) Am 09.07.2010 16:01, schrieb David Winsemius: > > On Jul 9, 2010, at 9:46 AM, Eik Vettorazzi wrote: > >> Hi Nils, >> have a look at >> ?tapply >> hth. > > Perhaps this will be part way there (I

[R] how can achive step by step execution of the script

2010-07-09 Thread vijaysheegi
Hi R Experts, I have certain code ,i want to achive interactive execution . For ex: 1. as part of input ,it should ask file name or table name as input. 2.in script so many graphs i need to draw,it should wait till certain key is pressed . 3:i am using windows R,rscript is not working. Please

[R] ttrTests issue in cReturns

2010-07-09 Thread Raghu
cr<-cReturns(spData,ttr="MACD") Error in ind[t - k] <- pos[t - k + 1] - pos[t - k] : replacement has length zero > cr<-cReturns(spData,ttr="macd4") Why is the above error coming? macd4 works alright ( which is a custom function built by the ttrTests author) while MACD doesnt work. Thanks -- '

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-09 Thread Gabor Grothendieck
On Fri, Jul 9, 2010 at 9:35 AM, Dimitri Liakhovitski wrote: > Hello! > > Any hint would be greatly appreciated. > I have a data frame that contains (a) monthly dates and (b) a value > that corresponds to each month - see the data frame "monthly" below: > > monthly<-data.frame(month=c(20100301,2010

[R] installing packages over ssh without X forwarding

2010-07-09 Thread petr
Hi, Is it possible to install packages without the testing if installed package can be loaded? I need to install bunch of packages on multiple computers over ssh. Some packages witch interact with X11 display cannot be installed in this way. for example after: > install.packages('cairoDevice',dep=T

Re: [R] How can i draw a graph with high and low data points

2010-07-09 Thread Nathaniel Saxe
Hi Tal, Thanks for your help. I've had a look at the site, and what i wanted to do was to plot X and Y where X is a characters and Y is numeric. The problem I'm having now is that the X axis isn't characters but just numbers from 1 onwards and when i plot it, the data i have is in descending ord

[R] how can achive step by step execution of the script

2010-07-09 Thread vijaysheegi
-- View this message in context: http://r.789695.n4.nabble.com/how-can-achive-step-by-step-execution-of-the-script-tp2283207p2283207.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] split with list

2010-07-09 Thread Joris Meys
One solution is to put these unwanted entries to "" repor$9853312 [1:2,2:3] <- "" Cheers Joris On Fri, Jul 9, 2010 at 12:18 PM, n.via...@libero.it wrote: > > Dear List I would like to ask you something concenting a better print of the > R output: > I have a bit data frame which has the follo

  1   2   >