[R] OT ; Interview with David Smith, REvolution Computing

2009-05-30 Thread Ajay ohri
Dear R community, Here is an interview with David Smith, Director of Community at REvolution Computing. David talks of the exciting work being done at REvolution to help make R reach out to even more users. http://www.decisionstats.com/2009/05/29/interview-david-smith-revolution-computing/ Best,

[R] how to sort data frame order by column?

2009-05-30 Thread Угодай n/a
I have a data frame, for exampe > dat <- data.frame(a=rnorm(5),b=rnorm(5),c=rnorm(5)) ab c 1 -0.1731141 0.002453991 0.1180976 2 1.2142024 -0.413897606 0.7617472 3 -0.9428484 -0.609312786 0.5132441 4 0.1343336 0.178208961 0.7509650 5 -0.1402286 -0.333476839 -

[R] mapply

2009-05-30 Thread KARAVASILIS GEORGE
Hello, R users. I would like to count the number of triples (r_i, s_j, t_k) with r_i, s_j, t_k distinct and abs((r_i-t_k)-u)=0 and abs((s_j-t_k)-v)=0, where r_i, s_j, t_k are the elements of three vectors a,b,c with different lengths and u,v=1:n. I have solved this problem writing a subroutine

Re: [R] 'options=utils::recover' not working in .Rprofile or within R

2009-05-30 Thread Duncan Murdoch
David Winsemius wrote: You are wiping out all of the default options with that approach. Actually, I think it hid the options() function. Try (after restarting R to get the other options back to what they should be): op=options() # so you can reset back to baseline opti

Re: [R] 'options=utils::recover' not working in .Rprofile or within R

2009-05-30 Thread David Winsemius
You are wiping out all of the default options with that approach. Try (after restarting R to get the other options back to what they should be): op=options() # so you can reset back to baseline options(error=utils::recover) # do not think the "utils::" is needed my.func <-

[R] R Solves Shakespeare Authorship Question

2009-05-30 Thread Arthur Burke
Those of you who track applications of R may be interested in the following: "The purpose of this paper is then to apply modern text analysis techniques using the R statistical packege [sic] to compare the works attributed to Shakespeare to those of leading alternate candidates such as Sir Frances

Re: [R] 'options=utils::recover' not working in .Rprofile or within R

2009-05-30 Thread Mark Kimpel
Duncan, I've pared down my .Rprofile so that it has just the options line, started R from terminal (instead of using ESS-emacs) and I still have the problem. Am I specifying the options incorrectly? I believe I took this directly from the help page. See my output of .Rprofile, the code example tha

Re: [R] setdiff bizarre (was: odd behavior out of setdiff)

2009-05-30 Thread Jason Rupert
Jay, Thanks again for all your help. I have ended up with something similar that appears to work and truly does provide the difference of two data frames including all the duplicate rows that may be removed due to filtering. Thanks again as this will be very helpful to me going forward a

Re: [R] IP-Address

2009-05-30 Thread Gabor Grothendieck
Here is yet another way: library(gtools) DF[mixedorder(DF$ip), ] On Fri, May 29, 2009 at 12:51 AM, edwin Sendjaja wrote: > > Hi, > > Is there any way to sort a tabel with a colum with IP-address? > > table: > > id rank color status ip > 138 29746 yellow no 162.131.58.26 > 138 29746 red  yes  16

Re: [R] IP-Address

2009-05-30 Thread jim holtman
Here is yet another way (not sure if it has been submitted): > ip <- c("162.131.58.26","2.131.58.16","2.2.58.10","162.131.58.17") > # split it, create matrix and convert to numeric > ip.s <- do.call(rbind, strsplit(ip, '\\.')) > storage.mode(ip.s) <- 'numeric' > # now create index to sort by > ip.

Re: [R] IP-Address

2009-05-30 Thread edwin Sendjaja
Hi VQ, Thank you. It works like charm. But I think Peter's code is faster. What is the difference? Eddie > Date: Fri, 29 May 2009 11:44:15 +0200 > From: waclaw.marcin.kusnierc...@idi.ntnu.no > To: p.dalga...@biostat.ku.dk > CC: r-help@r-project.org > Subject: Re: [R] IP-Address > > Peter

Re: [R] IP-Address

2009-05-30 Thread edwin Sendjaja
Hi Peter, This works as I expected. Thank you very much. Eddie > Date: Fri, 29 May 2009 11:15:37 +0200 > From: p.dalga...@biostat.ku.dk > To: all...@cybaea.com > CC: r-help@r-project.org > Subject: Re: [R] IP-Address > > Allan Engelhardt wrote: > > IP addresses are very (very!) difficult

Re: [R] IP-Address

2009-05-30 Thread edwin Sendjaja
Hi Allan, Thank you for your reply. I have more than 4 Rows. I don't believe than it's a good solution, if I need to write down all of the values. I have about 200 Rows. Do you have any other solution?. Is there any package that I can use? Edwin > Date: Fri, 29 May 2009 09:59:40 +0100

Re: [R] A problem about "nlminb"

2009-05-30 Thread Ravi Varadhan
Popo, If you indeed have 20 unknowns to be estimated, I would suggest that you check out spg() function in the "BB" package. This requires small storage and hence can better handle high-dimensional problems. Ravi. Ravi

Re: [R] setdiff bizarre (was: odd behavior out of setdiff)

2009-05-30 Thread G. Jay Kerns
Jason, (moved back to R-help) On Sat, May 30, 2009 at 3:30 PM, Jason Rupert wrote: > > Jay, > > > I really appreciate all your help help. > > I posted to Nabble an R file and input CSV files more accurately > demonstrating what I am seeing and the output I desire to achieve when I > difference

Re: [R] SEM/path question

2009-05-30 Thread Jarrett Byrnes
I've enjoyed Jim Grace's Structural Equation Modeling and Natural Systems http://www.amazon.com/Structural-Equation-Modeling-Natural-Systems/dp/0521546532/ref=sr_1_2?ie=UTF8&s=books&qid=1243719710&sr=8-2 as well as Rex Kline's Principles and Practice of Structural Equation Modeling http:

Re: [R] A problem about "nlminb"

2009-05-30 Thread spencerg
You example is NOT self contained, which means that any potential respondent must guess what you mean by "a function with a variable of almost 200,000". The following clarifies this: > start0 <- rep(1, 20) > msLE2 <- function(x)sum(x^2) > nlminb(start=start0, msLE2, control = list(x

Re: [R] strange behavior when reading csv - line wraps

2009-05-30 Thread Ted Harding
In a private correspondence with Martin Tomko, I think the reason for the problem has been found. The numbers of ";"-separated fields in the 82 successive lines of his file are as follows: 01:26 02:26 03:33 04:33 05:12 06:12 07:12 08:12, 09:19 10:19 11:17 12:17 13:23 1

Re: [R] A problem about "nlminb"

2009-05-30 Thread David Winsemius
On May 30, 2009, at 2:19 PM, popo UBC wrote: Hello everyone! When I use "nlminb" to minimize a function with a variable of almost 200,000 dimension, I got the following error. nlminb(start=start0, msLE2, control = list(x.tol = .001)) Error in vector("double", length) : vector size specif

Re: [R] strange behavior when reading csv - line wraps

2009-05-30 Thread jim holtman
It is still not clear to me exactly how you want to read the lines in. If the lines have a variable number of fields, and some of the lines might be wrapped, is there some way to determine where the start of each line is. If you are reading them in with read.csv, then the system is assuming that

Re: [R] Simple.lm

2009-05-30 Thread David Winsemius
On May 30, 2009, at 1:22 PM, malcolm Crouch wrote: Hi , I am struggling with two problems : 1. simple.lm - where do i find the package that installs that ... i have a looked on the help files and it says simple but when i go to cran through load.packages() it does not come up ? Unde

[R] improve efficiency of a loop

2009-05-30 Thread Nelson Villoria
Dear All: I need advice about efficient looping/vectorization. I am trying to bootstrap a regression model with one lag of the dependent variable in the RHS. Specifically, let error^b_(t) be the bootstrapped error of the regression y_(t) = gamma y_(t-1) + beta x +error_(t) at time (t), y_(t) is th

[R] A problem about "nlminb"

2009-05-30 Thread popo UBC
Hello everyone! When I use "nlminb" to minimize a function with a variable of almost 200,000 dimension, I got the following error. > nlminb(start=start0, msLE2, control = list(x.tol = .001)) Error in vector("double", length) : vector size specified is too large I had the following setting option

Re: [R] Simple.lm

2009-05-30 Thread John Sorkin
To find simple.lm, I suggest you look in the package UsingR You may need to load the package; it is not installed by default when you load R on your computer. I regret that I can not help you with your second question. John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Unive

[R] Simple.lm

2009-05-30 Thread malcolm Crouch
Hi , I am struggling with two problems : 1. simple.lm - where do i find the package that installs that ... i have a looked on the help files and it says simple but when i go to cran through load.packages() it does not come up ? 2. whenever I use qq.plot through library(car) it mentions i n

Re: [R] arithmetic problem

2009-05-30 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Gabor Grothendieck > Sent: Saturday, May 30, 2009 9:11 AM > To: Iain Gallagher > Cc: r-help@r-project.org > Subject: Re: [R] arithmetic problem > > Here are are assuming > > 1.

Re: [R] arithmetic problem

2009-05-30 Thread Gabor Grothendieck
Here are are assuming 1. for each row that if that row's value is within 200 - 300 of the prior or next value with the same ind then that row should be extracted. 2. the input is sorted by values within ind If that's not the intention then modify the code accordingly. First we read in the data i

Re: [R] R's documentation

2009-05-30 Thread David Winsemius
On May 30, 2009, at 2:01 AM, Zeljko Vrba wrote: On Fri, May 29, 2009 at 05:20:24PM +0100, Patrick Burns wrote: If you find some documentation that is confusing, then you can write a message about it that states: I think that some kind of a glossary would be helpful. Then I would know whet

[R] arithmetic problem

2009-05-30 Thread Iain Gallagher
Hello list I have a problem with a dataset (see toy example below) where I am trying to find the difference between two (or more numbers) and discard those observations which fall outside a set interval. An example and further explanation: values ind 12655 7A5 23028

Re: [R] Looping until a solution is found

2009-05-30 Thread John Poulsen
Yes, it is wrapped around the code in mlefun, but could be changed... Thanks again, John. David Winsemius wrote: On May 30, 2009, at 9:36 AM, Uwe Ligges wrote: John Poulsen wrote: Hello, I am using maximum likelihood to find the best parameters for a model. This involves sometimes tweak

Re: [R] Looping until a solution is found

2009-05-30 Thread Uwe Ligges
David Winsemius wrote: On May 30, 2009, at 9:36 AM, Uwe Ligges wrote: John Poulsen wrote: Hello, I am using maximum likelihood to find the best parameters for a model. This involves sometimes tweaking the starting values to find a solution that converges. I would like to automate the pro

Re: [R] Looping until a solution is found

2009-05-30 Thread David Winsemius
On May 30, 2009, at 9:36 AM, Uwe Ligges wrote: John Poulsen wrote: Hello, I am using maximum likelihood to find the best parameters for a model. This involves sometimes tweaking the starting values to find a solution that converges. I would like to automate the process so that when the op

Re: [R] Still can't find missing data - How do I get NA in xtabs with factors?

2009-05-30 Thread Uwe Ligges
Farley, Robert wrote: Let's see if I understand this. Do I iterate through x <- factor(x, levels(c(levels(x), NA), exclude=NULL) for each of the few hundred variables (x) in my data frame? Yes, for all being factors. Best, Uwe Ligges I tried to do this all at once and failed: ToyD

Re: [R] strsplit

2009-05-30 Thread Uwe Ligges
Henrique Dallazuanna wrote: Try this: unlist(part)[1] or part[[1]][1] And in order to isnpect your objects, use str(part) at first which tells you about the structure of the object. Then you know you got a list and can look up how to extract a part of a list as Henrique Dallazuanna pon

Re: [R] Looping until a solution is found

2009-05-30 Thread Uwe Ligges
John Poulsen wrote: Hello, I am using maximum likelihood to find the best parameters for a model. This involves sometimes tweaking the starting values to find a solution that converges. I would like to automate the process so that when the optimizer runs into an error it tweaks one of th

[R] Looping until a solution is found

2009-05-30 Thread John Poulsen
Hello, I am using maximum likelihood to find the best parameters for a model. This involves sometimes tweaking the starting values to find a solution that converges. I would like to automate the process so that when the optimizer runs into an error it tweaks one of the parameters slightly,

Re: [R] Quantile GAM?

2009-05-30 Thread Mark Difford
Hi Jonathan, >> I was wondering if anyone had suggestions on how to implement a GAM >> in a quantile fashion? Take a look at the gamlss package. Regards, Mark. Jonathan Greenberg-2 wrote: > > R-ers: > > I was wondering if anyone had suggestions on how to implement a GAM > in a quanti

[R] Y label with bold superscript

2009-05-30 Thread Arnaldo Russo
Hi, I`m trying to put my superscript type in bold style. Could somebody help me? My text is inside a barplot. #!/bin/R barplot(x, ylab=expression(paste("org.", cm^-2))) # so I tried this way, barplot(x, ylab=expression(bold(paste("org.", cm^-2 # but my superscript maintain its shape in reg

Re: [R] Help for running R2WINBUGS in VISTA

2009-05-30 Thread Uwe Ligges
satrajit roychoudhury wrote: Dear, I am running the following R code using the R2WINBUGS package. fit<-bugs( model.file=BUGScode, data=data, inits = list(geninits1,geninits2), parameters.to.save=keepers, n.chains=nchains, n.iter=runs, n.burnin=burn, n.thin=nthin, bugs.directory="C

[R] what is 'class.ind' here?

2009-05-30 Thread onyourmark
Hi. The there is an example in nnet help which is pasted in below. I am not sure how they are generating 'targets'. What is the 'class.ind() function doing? In the help docs for it they say "Generates a class indicator function from a given factor." I tried putting a simple vector of the "classes"

Re: [R] 'options=utils::recover' not working in .Rprofile or within R

2009-05-30 Thread Duncan Murdoch
[Sent this before completing my last sentence; here's another attempt] On 29/05/2009 11:45 PM, Mark Kimpel wrote: For years I have been using options(error = recover) either in .Rprofile or from within R for debugging purposes. The functionality of this appears to have changed and I can't recove

Re: [R] 'options=utils::recover' not working in .Rprofile or within R

2009-05-30 Thread Duncan Murdoch
On 29/05/2009 11:45 PM, Mark Kimpel wrote: For years I have been using options(error = recover) either in .Rprofile or from within R for debugging purposes. The functionality of this appears to have changed and I can't recover it (no pun intended) using the ?options help page. How can I get the o

Re: [R] Quantile GAM?

2009-05-30 Thread Gavin Simpson
On Fri, 2009-05-29 at 16:51 -0700, Jonathan Greenberg wrote: > R-ers: > > I was wondering if anyone had suggestions on how to implement a GAM > in a quantile fashion? I'm trying to derive a model of a "hull" of > points which are likely to require higher-order polynomial fitting (e.g. > sp

Re: [R] strange behavior when reading csv - line wraps

2009-05-30 Thread Martin Tomko
Jim, the two lines I put in are the actual problematic input lines. In these examples, there are no quotes nor # signs, although I have no means to make sure they do not occur in the inputs (any hints how I could deal with that?). I am trying to avoid as much pre-processing outside R as possible

Re: [R] R's documentation

2009-05-30 Thread Patrick Burns
Zeljko Vrba wrote: On Fri, May 29, 2009 at 05:20:24PM +0100, Patrick Burns wrote: If you find some documentation that is confusing, then you can write a message about it that states: I think that some kind of a glossary would be helpful. Then I would know whether certain words or phrases ar

[R] Spatiotemporal correlation function

2009-05-30 Thread FMH
Hi, I'm trying to compute  the spatiotemporal correlation matrix by using Delta Kronecker products of spatial and temporal correlation matrix  in R, but didn't find any delta Kronecker's operator in R. The operators in matrix such as multiplication, addition, eigen values/vector and etc is easi