Re: [R] Identifying breakpoints/inflection points?

2010-04-26 Thread Charlotte Chang
Hi Clint, Thank you for your help with the code. The span recommendation really improved the fit of my LOESS curve. I appreciate your thoughtful assistance! My remaining question is how could I go about identifying the inflection points for the LOESS curve? I was thinking about trying to find the

Re: [R] selecting rows based on number that occurs after letter

2010-04-26 Thread Dennis Murphy
Hi: This seems to be easier to pull off if x is a data frame rather than a matrix. x <- data.frame(GCM = c("BA1y1","BA2y3","C3A1r1y1","C3A2r2y2t4","C3r2y1y1"), y = c(1:3, 11, 12), stringsAsFactors = FALSE) x$val <- as.numeric(substring(lapply(strsplit(x$GCM, 'y'), '[

Re: [R] Problem with 'lars' package

2010-04-26 Thread Tal Galili
The CRAN website is down, and will remain so for the next few hours, see link for alternative images: http://www.r-bloggers.com/r-project-websites-down/ Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read

Re: [R] Bhapkar V test

2010-04-26 Thread Tal Galili
Hi Karl, I don't think this is the solution, but just in case - the coin package has a reference for the: "homogeneity statistic W of * Bhapkar* (1966)" Might it be related to V test ? Best, Tal Contact Details:--- Contact me: t

Re: [R] Histogram not plotting correct breaks

2010-04-26 Thread Tal Galili
trying setting br = 40 inside the hist, and check if that helps... (breaks won't do it for you either way) Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biost

Re: [R] Mathematical symbol

2010-04-26 Thread Peter Ehlers
Type ?"||" and read the help page. If it helps, the statement is equivalent to if( (a < 10) || (j > 100) ) -Peter Ehlers On 2010-04-26 23:00, assaedi76 assaedi76 wrote: R users Thanks in advance Could someone tell me what this condition means: if ( a< 10 | |j> 100) Thanks

Re: [R] selecting rows based on number that occurs after letter

2010-04-26 Thread Daisy Englert Duursma
Hello, Thanks for your help, I have played around with the suggestion a bit but I can still not sub-setting in the way I need If I have a matrix x as follows: > x <- matrix(c("BA1y1","BA2y3","C3A1r1y1","C3A2r2y2t4","C3r2y1y1",1,2,3, 11,12) , nrow=5, ncol=2, dimnames=list(c("a","b","c","d","e")

Re: [R] Confusing concept of vector and matrix in R

2010-04-26 Thread Peter Ehlers
On 2010-04-26 20:05, Matthew Keller wrote: Rolf: "Well then, why don't you go away and design and build your own statistics and data analysis language/package to replace R?" What a nice reply! The fellow is just trying to understand R. That response reminds me of citizens of my own country who c

[R] Mathematical symbol

2010-04-26 Thread assaedi76 assaedi76
R users   Thanks in advance   Could someone tell me what this condition means:   if ( a <  10  | |    j > 100)   Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] How to make legend with line+ character

2010-04-26 Thread Mario Valle
Thanks John and thanks to all! Seems this requires a lot of effort anyway. So maybe it is better to take a different approach: take the legend out of the chart and put it on a plot.new() on the right of the chart, use only colored letters but make them larger to be visible. Thanks!

[R] How to work out 3-way probabilities

2010-04-26 Thread Dimitrij Kudriavcev
Hello. I have a quick question. I try to use logit regression, to work out probabilities in the sport event. I have work out probabilities for group of 2 players: p1 - probability, what player1 will beat player2 p2 - probability, what player2 will beat player1 pt - tie probability, p1 <- 1 - p1

[R] Histogram not plotting correct breaks

2010-04-26 Thread burgundy
Hi, I'm using the hist function to plot the frequency of 21 variables, but it keeps starting the x-axis from 0 and adding variables 1 and 2 together (all other vairables have the correct frequencies). I suspect it adds 1 and 2 together so that 0 can fit in with demarcations at intervals of 5. Usi

Re: [R] Confusing concept of vector and matrix in R

2010-04-26 Thread Charles C. Berry
On Mon, 26 Apr 2010, Stuart Andrews wrote: Thanks Charles, for clarifying. My statement holds for matrices, which are 2 dimensional. And, as you mentioned, a single index implies vector indexing where the drop argument doesn't make sense. I am somewhat relieved, given this new understandi

Re: [R] when setting environment: target of assignment expands to non-language object

2010-04-26 Thread Gabor Grothendieck
See ?lockBinding On Mon, Apr 26, 2010 at 11:20 PM, Michael Steven Rooney wrote: > I tried editing the corExp function (added a line) within the nlme > environment with the following code, but it looks like my declaration did > not have any effect. I am guessing it is locked some how. Is there an

Re: [R] when setting environment: target of assignment expands to non-language object

2010-04-26 Thread Michael Steven Rooney
I tried editing the corExp function (added a line) within the nlme environment with the following code, but it looks like my declaration did not have any effect. I am guessing it is locked some how. Is there an easy way to do this or am I treading into complicated waters? (I just picked up R a year

Re: [R] when setting environment: target of assignment expands to non-language object

2010-04-26 Thread Michael Steven Rooney
Thanks. How do I make my function visible to others? Will assignInNamespace do that? On Mon, Apr 26, 2010 at 10:23 PM, Gabor Grothendieck < ggrothendi...@gmail.com> wrote: > See ?assignInNamespace > > On Mon, Apr 26, 2010 at 9:49 PM, Michael Steven Rooney > wrote: > > Hi, > > > > I am trying to

Re: [R] Confusing concept of vector and matrix in R

2010-04-26 Thread Stuart Andrews
Thanks Charles, for clarifying. My statement holds for matrices, which are 2 dimensional. And, as you mentioned, a single index implies vector indexing where the drop argument doesn't make sense. I am somewhat relieved, given this new understanding. But I am still puzzled as to why R

Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-26 Thread Duncan Murdoch
Mandy Xu wrote: Hi R users, Does anyone know how to change the size of 3d charts? I'm using surface3d in rgl package, opening a new window each time to display the chart. I want it so that the chart fills the whole window, because when I output it to png, I don't want all the white space around

Re: [R] when setting environment: target of assignment expands to non-language object

2010-04-26 Thread Gabor Grothendieck
See ?assignInNamespace On Mon, Apr 26, 2010 at 9:49 PM, Michael Steven Rooney wrote: > Hi, > > I am trying to place my own functions in the nlme environment: > > The following statement works: > > environment(coef.corSPT) <- environment(getS3method("coef","corSpatial")) > > but this one returns a

[R] Bhapkar V test

2010-04-26 Thread Karl-Dieter Crisman
Dear R help, Is there a package which performs the Bhapkar V test (or any of the Bhapkar-Deshpande L-type tests), preferably on the same sort of data set input which kruskal.test() takes? I haven't been able to find anything so far (the one reference to Bhapkar seems to be some other test, though

Re: [R] when setting environment: target of assignment expands to non-language object

2010-04-26 Thread Duncan Murdoch
Michael Steven Rooney wrote: Hi, I am trying to place my own functions in the nlme environment: I'm not that does what you want. It doesn't place your function in the environment, it attaches the environment to your function. The difference is that other functions won't see yours, but y

Re: [R] Tapply.

2010-04-26 Thread Dennis Murphy
Hi: > On Mon, Apr 26, 2010 at 8:01 AM, steven mosher wrote: > Thanks, > I was trying to stick with the base package and figure out how the base routines worked. If you want to use base functions, then here's a solution with aggregate: (the Id column was removed first): > with(DF, aggregate(DF[

Re: [R] Manipulating text files

2010-04-26 Thread galen kaufman
Thank you so much for the help. Is the idea behind doing this to convert the text file to a dataframe to allow me to work with and manipulate it? Also, if I do convert it to a dataframe how do I reconvert it to a text file so that I can run it as a properly formatted input file in the wat

Re: [R] Confusing concept of vector and matrix in R

2010-04-26 Thread Matthew Keller
Rolf: "Well then, why don't you go away and design and build your own statistics and data analysis language/package to replace R?" What a nice reply! The fellow is just trying to understand R. That response reminds me of citizens of my own country who cannot abide by any criticism of the USA: "If

[R] how to set chart output size in rgl (surface3d)?

2010-04-26 Thread Mandy Xu
Hi R users, Does anyone know how to change the size of 3d charts? I'm using surface3d in rgl package, opening a new window each time to display the chart. I want it so that the chart fills the whole window, because when I output it to png, I don't want all the white space around the chart (right n

[R] when setting environment: target of assignment expands to non-language object

2010-04-26 Thread Michael Steven Rooney
Hi, I am trying to place my own functions in the nlme environment: The following statement works: environment(coef.corSPT) <- environment(getS3method("coef","corSpatial")) but this one returns an error: environment(get("coef<-.corSPT")) <- environment(getS3method("coef<-","corSpatial")) Error

Re: [R] liner regression for multiple keys

2010-04-26 Thread newbie_2010
Hi Ben it's working good except no values of 4th column in output. And also if the file is large I'm getting the following error. Error in pf(q, df1, df2, lower.tail, log.p) : Non-numeric argument to mathematical function I rechecked if I have any non numeric arguments the defined columns. I

[R] Upgrading R using the "global library folder" strategy -, what do you think about it?

2010-04-26 Thread R P Herrold
On Mon, 26 Apr 2010, Marshall Feldman wrote: So why not have the appropriate scripts ask a few questions upon the first installation of R (e.g., "Do you want to configure R with a "global" library for packages to make future upgrading easier?") and at upgrade time ("Your previous version of R

Re: [R] Confusing concept of vector and matrix in R

2010-04-26 Thread Charles C. Berry
On Mon, 26 Apr 2010, Stu wrote: Hi all, One subtlety is that the drop argument only works if you specify 2 or more indices e.g. [i, j, ..., drop=F]; but not for a single index e.g [i, drop=F]. Wrong. a <- structure(1:5,dim=5) dim(a) [1] 5 dim(a[2:3,drop=F]) # don't drop regardless [1] 2

[R] Question on StatET

2010-04-26 Thread Shige Song
Dear All, Does anyone know how to get StatET to do automatic word wrapping for Sweave document? I am new to StatET, so please pardon me if I missed something obvious. Many thanks. Best, Shige __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] Unable to connect to 'cran.r-project.org' on port 80.

2010-04-26 Thread Cedrick W. Johnson
There was a notice earlier today about a power outage affecting the main CRAN site.. For installing packages, try: install.packages("packagename", repos="http://cran.wustl.edu";) or to perform an upgrade: update.packages(repos="http://cran.wustl.edu";) until the main CRAN site has been resolve

[R] Unable to connect to 'cran.r-project.org' on port 80.

2010-04-26 Thread Caitlin
Hi. I recently upgraded my R installation to 2.11.0 on Windows XP (SP3) without changing any firewall settings. When I attempted to update my package list, the 'Select a mirror' took much longer than it normally did, and after I finally selected the site, I saw: --- Please select a CRAN mirror fo

[R] Problem with 'lars' package

2010-04-26 Thread khasanova
Hi, I'm having trouble running 'lars'. When I install it I get the following warning: >install.packages('lars') Warning in install.packages("lars") : argument 'lib' is missing: using 'C:\Users\Anna\Documents/R/win-library/2.10' --- Please select a CRAN mirror for use in this session --- trying U

[R] plotmeans in trellis view?

2010-04-26 Thread DougB
Is there a way to use plotmeans function of Gplots in a trellis view with the trellis groups defined by a column? -- View this message in context: http://r.789695.n4.nabble.com/plotmeans-in-trellis-view-tp2065860p2065860.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Confusing concept of vector and matrix in R

2010-04-26 Thread Stu
Hi all, One subtlety is that the drop argument only works if you specify 2 or more indices e.g. [i, j, ..., drop=F]; but not for a single index e.g [i, drop=F]. Why doesn't R complain about the unused "drop=F" argument in the single index case? Cheers, - Stu a = matrix(1:10, nrow=1) b = matrix(

Re: [R] Remove duplicated rows

2010-04-26 Thread chrisli1223
Thank you Petr, Gustaf and Gabor. Your help is much appreciated. I have tried: dataset[!duplicated(dataset[,-2]),] and it solves my problem. Thanks, Chris -- View this message in context: http://r.789695.n4.nabble.com/Remove-duplicated-rows-tp2023065p2065997.html Sent from the R help mailing

Re: [R] I can't with expression

2010-04-26 Thread Paul Murrell
Hi How about ... ? library(grid) # grid.newpage() grid.text(expression(italic(P[SF]^{""%up%""}))) ... or possibly a bit easier to read ... grid.text(expression(italic(P[SF]^symbol("\255" Paul salca...@obelix.umh.es wrote: Hi all, I need an R expression, expression() to get the foll

Re: [R] plotmeans in trellis view?

2010-04-26 Thread Sam Albers
I'm not sure about "plotmeans" but this is usually the way I plot means with lattice: library(lattice) x <- runif(48, 2, 70) data <- data.frame(x) data$factor1 <- factor(c("A", "B", "C", "D")) data$factor2 <- factor(c("X", "Y", "Z")) data.mean <- with(data, aggregate(data$x, by=list(factor1=fact

Re: [R] How to make legend with line+ character

2010-04-26 Thread John Kane
I suspect that you may have to construct the legend by hand (well, by explicit text commands anyway) Something like this seems to work and it should not be that difficult to write a function to handle the text commands. plot(1:10,10:1,lty=1,type='b', lwd=2,pch='a') text(1.4,6, label="-a- ",

Re: [R] Identifying breakpoints/inflection points?

2010-04-26 Thread Clint Bowman
Charlotte, Try: birds.lo <- loess(piproute~year,span=.25) # play with span to see your desired pattern birds.pr<-predict(birds.lo, data.frame(year = seq(1967, 2009, 1)), se = FALSE) # plot($year,birds.pr$fit,ylim=c(0,5)) par(new=T) plot(year,birds.pr$fit,pch="+",col=2,ylim=c(0,5)) -- Clint B

Re: [R] numerical or not?

2010-04-26 Thread Ted Harding
On 26-Apr-10 21:19:51, Laetitia Schmid wrote: > Hi, > I've had a little problem for several weeks now. It is annoying and > therefore I will ask for help: > When I write a script with several iterations, I make it write out a > text file to save the data during the run. For example I write: > if (i

Re: [R] numerical or not?

2010-04-26 Thread John Kane
I don't seem to be able to duplicate the problem. Using your read.table command I get a data.frame (which is of course a type of list) and something like sum(dat1[,1] gives me a numerical result. What variable is giving you the not numerical error message --- On Mon, 4/26/10, Laetitia Schmid

Re: [R] multiple paired t-tests without loops

2010-04-26 Thread Matthew Finkbeiner
Yes, I suspect that I will end up using a sampling approach, but I'd like to use an exact test if it's at all feasible. Here are two samples of data from 3 subjects: Sample SubjC1 C2 44 1 0.0093 0.0077 44 2 0.0089 0.0069 44 3 0.051 0.0432 44 4

[R] Identifying breakpoints/inflection points?

2010-04-26 Thread Charlotte Chang
Hello! I have a dataset with the following two vectors: year<-c(1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009) piproute<-c(0.733

Re: [R] Dropping "trailing zeroes" in longitudinal data

2010-04-26 Thread David Atkins
Bill-- Awesome; the code is perfect (for what we need). Thank you so much for your help. cheers, Dave Dave Atkins, PhD Research Associate Professor Department of Psychiatry and Behavioral Science University of Washington datk...@u.washington.edu Center for the Study of Health and Risk Behavi

Re: [R] numerical or not?

2010-04-26 Thread jim holtman
It would be quicker, and easier, to use save/load to keep your temporary output. Therefore you would not have to be concerned with a structure that would be compatible to write.table/read.table. 2010/4/26 Laetitia Schmid > Hi, > I've had a little problem for several weeks now. It is annoying an

Re: [R] numerical or not?

2010-04-26 Thread Sarah Goslee
I tried reading in your text file with the read.table statement you provided. Everything worked fine for me - str() shows that all values are integers, and functions such as summary() work as anticipated. You don't tell us *what* you are trying to do. One possible source of error is that read.tabl

Re: [R] barplot - offsetting individual bars

2010-04-26 Thread Kevin Turner
I see what your suggesting. Make the rain negative so that it plots on the other side of the axis. The axis labels can be adjusted accordingly. That makes it simple. Thanks for the help. On Mon, Apr 26, 2010 at 3:49 PM, Greg Snow wrote: > Does this do what you want? > > rainsnow <- rbind( c

Re: [R] write.csv size limit in R 2.11.0 -- crashes

2010-04-26 Thread Duncan Murdoch
On 26/04/2010 4:25 PM, N Klepeis wrote: Hi, I just installed R 2.11.0 Win32 and tried to use write.csv (or write.table) to write a 121000x26 data frame. This crashes R. The dataframe was written OK in R 2.10.1. I tried up to 108000 rows and the file was written OK. But then going to 109000

Re: [R] table command

2010-04-26 Thread Greg Snow
Is the fact that 0 is a possible and interesting value (even in being absent) a property of the table? Or a property of the variable? I would argue that it is probably a property of the variable, and this is the better way to work with it in R (some older programs forced us to specify this at t

Re: [R] multiple paired t-tests without loops

2010-04-26 Thread Greg Snow
The usual way to speed up permutation testing is to sample from the set of possible permutations rather than looking at all possible ones. If you show some code then we may be able to find some inefficiencies for you, but there is not general solution, poorly written uses of apply will be slower

Re: [R] seed

2010-04-26 Thread Greg Snow
The set.seed function works like you show. If you want to get a little fancier you can use the char2seed function from the TeachingDemos package, then you could set you seed with something like: > char2seed('jimmy') Or another string that represents the simulation. -- Gregory (Greg) L. Snow

Re: [R] change the size of matrix

2010-04-26 Thread Henrique Dallazuanna
You can use matrix: A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4)) B <- matrix(A, 2, 6) On Mon, Apr 26, 2010 at 4:58 PM, anderson nuel wrote: > I would find function which change the size automatically. > > For example: > > > A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4)) > > A > [,1] [,2] [

Re: [R] change the size of matrix

2010-04-26 Thread anderson nuel
I would find function which change the size automatically. For example: > A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4)) > A [,1] [,2] [,3] [,4] [1,]1 1086 [2,]42 119 [3,]753 12 B=func(A,2,6) B becomes: 13579 11 24

[R] write.csv size limit in R 2.11.0 -- crashes

2010-04-26 Thread N Klepeis
Hi, I just installed R 2.11.0 Win32 and tried to use write.csv (or write.table) to write a 121000x26 data frame. This crashes R. The dataframe was written OK in R 2.10.1. I tried up to 108000 rows and the file was written OK. But then going to 109000 causes the crash. Anyone else see this

Re: [R] failing to select a subset of observations based on variable values [Sec: UNCLASSIFIED]

2010-04-26 Thread David Winsemius
On Apr 26, 2010, at 3:39 PM, Gosse, Michelle wrote: Greetings all. I'm starting analysis in R on a reasonably sized pre-existing dataset, of 583 variables and 1127 observations. This was an SPSS datafile, which I read in using the read.spss command using the foreign package, and the data

Re: [R] Dropping "trailing zeroes" in longitudinal data

2010-04-26 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Atkins > Sent: Monday, April 26, 2010 12:23 PM > To: r-help@r-project.org > Subject: [R] Dropping "trailing zeroes" in longitudinal data > > > Background: Our research gro

Re: [R] 2 simple question

2010-04-26 Thread Greg Snow
A couple of additions to the suggestions that you have already received: 1. you can use par(mfrow=c(r,c)) to set up the plotting areas, then us par(mfg=c(r,c)) to tell R which frame to plot into. 2. you could start with an empty plot and use the subplot function (TeachingDemos package) to place

Re: [R] change the size of matrix

2010-04-26 Thread David Winsemius
On Apr 26, 2010, at 3:58 PM, anderson nuel wrote: I would find function which change the size automatically. Read the help page again. You have too quickly formed an erroneous conclusion. For example: > A=matrix(c(1,4,7,10,2,5,8,11,3,6,9,12),c(3,4)) > A [,1] [,2] [,3] [,4] [1,]

Re: [R] change the size of matrix

2010-04-26 Thread David Winsemius
On Apr 26, 2010, at 3:18 PM, anderson nuel wrote: Dear r-help, Could you help me to find the function which change the size of matrix . ?dim Best Regards David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list https://s

Re: [R] barplot - offsetting individual bars

2010-04-26 Thread Greg Snow
Does this do what you want? rainsnow <- rbind( c(0,1,2,3,2,1,0), c(2,2,1,0,0,1,2) ) rainsnow2 <- rbind( rainsnow[1,], -rainsnow[1,], -rainsnow[2,] ) fig=barplot(rainsnow2, horiz=TRUE, space=0, col=c("grey70",NA, "white"), axes=FALSE) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Inte

[R] failing to select a subset of observations based on variable values [Sec: UNCLASSIFIED]

2010-04-26 Thread Gosse, Michelle
Greetings all. I'm starting analysis in R on a reasonably sized pre-existing dataset, of 583 variables and 1127 observations. This was an SPSS datafile, which I read in using the read.spss command using the foreign package, and the data was assigned to a data.frame when it was read in. The defa

Re: [R] formatted output facilities ... was ..Oddity with internet access and R 11.0 - solved

2010-04-26 Thread Greg Snow
If you like the idea of ODFWeave, but don't want to trasition to open office then you may want to look at sword from the same group that brought us RExcel (http://rcom.univie.ac.at/download.html). It looks like Sword is still in beta, but it plans to do the same for MSWord as ODFWeave does for

[R] lm.ridge {MASS} intercept questions

2010-04-26 Thread Jimmy Purnell
I am trying to understand the code for lm.ridge from the MASS package. Here is the part I am having trouble understanding: if(Inter <- attr(Terms, "intercept")) { Xm <- colMeans(X[, -Inter]) Ym <- mean(Y) p <- p - 1 X <- X[, -Inter] - rep(Xm, rep(n, p)) Y <- Y - Ym } else Ym <- Xm <- NA Xscale <-

Re: [R] reordering of matrix rows to maximize the sum of the diagonal

2010-04-26 Thread Ravi Varadhan
Jonathan, You can find the permutation of A that maximizes its trace by minimizing ||PA - I|| in Frobenius norm, where P is the permutation matrix, A is a square matrix, and I is the identity matrix. Here is the code that solves the abovementioned problem: pMatrix.min <- function(A, B) { # finds

Re: [R] RServe across network

2010-04-26 Thread Cedrick W. Johnson
Is it [server/rserve] running on Windows or Linux? -c On 4/26/2010 2:19 PM, Nupur Gupta wrote: > Hi, > I am trying to connect to RServe across a network. > > I had put RServe on my local machine and it worked just fine. When am try to > connect to it across a network - it is able to go through the

[R] Dropping "trailing zeroes" in longitudinal data

2010-04-26 Thread David Atkins
Background: Our research group collected data from students via the web about their drinking habits (alcohol) over the last 90 days. As you might guess, some students seem to have lost interest and completed some information but not all. Unfortunately, the survey was programmed to "pre-popu

[R] change the size of matrix

2010-04-26 Thread anderson nuel
Dear r-help, Could you help me to find the function which change the size of matrix . Best Regards [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posti

Re: [R] How do you change library location ? (in R under windows XP)

2010-04-26 Thread Tal Galili
Thank you Mike, That is indeed what I used in the code eventually. http://www.r-statistics.com/2010/04/changing-your-r-upgrading-strategy-and-the-r-code-to-do-it-on-windows/ Thanks for answering, Tal Contact Details:--- Contact m

Re: [R] R.GBM package

2010-04-26 Thread Changbin Du
Got it, thanks so much! Greg. On Mon, Apr 26, 2010 at 11:02 AM, Ridgeway, Greg wrote: > Y~X1+X2+X3 is the standard R formula syntax. It simply means "Y is > predicted by X1 and X2 and X3". > > Greg > > -- > *From:* Changbin Du [mailto:changb...@gmail.com] > *Sent:*

Re: [R] Upgrading R using the "global library folder" strategy - what do you think about it?

2010-04-26 Thread Mike Prager
I think it makes more sense for most users to have a global library (as you call it), rather than put the library under the current installation. I have been doing that for years, and it saves a lot of trouble. When I have helped people learn R, the need to copy the library when updating is a reg

Re: [R] reordering of matrix rows to maximize the sum of the diagonal

2010-04-26 Thread Jonathan
Hi Dennis, Thanks for the idea, but the order of the rowSums does not necessarily correspond to the order of rows that maximizes the "rank" of the matrix. Ex: > a[1:9]<-c(1,1,30,50,1,1,1,20,1) > a [,1] [,2] [,3] [1,]1 501 [2,]11 20 [3,] 3011 > a[order(rowSum

Re: [R] R and S-Plus: Two programs separated by a common language?

2010-04-26 Thread Mike Prager
On Thu, 22 Apr 2010 12:00:13 -0700 (PDT), Paul Miller wrote: >I was just wondering if anyone could give me some advice about the wisdom or >folly of trying to use both [R and S-Plus]. I suspect that trying to use both will give you heartburn. When I switched from S-Plus to R, the most significa

Re: [R] How do you change library location ? (in R under windows XP)

2010-04-26 Thread Mike Prager
On Fri, 23 Apr 2010 15:22:45 +0300, Tal Galili wrote: >Due to the new R 2.11 release, I want to implement Dirk's suggestion >here >. > >So for that I am asking - How can I (permanently) change R's library path?

Re: [R] Why am I getting different results from cor VS ccf ?

2010-04-26 Thread Tal Galili
The dear mark leeds Has pointed me that the answer to my question was in the MASS book, in page 390 Where it is said that acf works by dividing the covariance with N instead of N-t so to insure that the covariance sequence is positive definite. Although I am not sure if to my purposes it means I

[R] RServe across network

2010-04-26 Thread Nupur Gupta
Hi, I am trying to connect to RServe across a network. I had put RServe on my local machine and it worked just fine. When am try to connect to it across a network - it is able to go through the handshake and get in. However , when it gets to the 'request' method in the RTalk class, it hangs. Any i

Re: [R] help with code

2010-04-26 Thread Sarah Goslee
Hi Randy, > The SAS code for what I want to do is: > /* > >  if FTIStandKey=" NAH6253-003" then do; > >   CoverType=" XSOP--C "; > >   V_SpGrp="T"; > >   V_Origin="T"; > >  end; > I admit I didn't read all the sample code you added, but this is what I *think* you're trying to accomplish. myd

Re: [R] Help with replacement of certain values in dataset with SAS code equivalent

2010-04-26 Thread Erik Iverson
What I want to do is to be able to select certain FTIStandKey's and change values in the dataset. For example, I would like to select by FTIStandKey=="NAH6253-003", and change the entries for CoverType=" XSOP--C " and change the V_SpGrp=="T", and also change V_Origin=="T". I only want to c

Re: [R] Sweave

2010-04-26 Thread Jimmy Söderly
Thanks !!! 2010/4/26 Gabor Grothendieck > Sorry, typo. Try this: > > file.path(R.home(), "share", "texmf", "Sweave.sty") > > On Mon, Apr 26, 2010 at 1:18 PM, Gabor Grothendieck > wrote: > > Its at this path (this command is issued from within R): > > > > file.path(R.home(), "share", "textmf",

[R] Why am I getting different results from cor VS ccf ?

2010-04-26 Thread Tal Galili
Hi all, I am getting different results from ccf and cor, Here is a simple example: set.seed(100) N <- 100 x1 <- sample(N) x2 <- x1 + rnorm(N,0,5) ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1] cor(x1[-N], x2[-1]) Results: > ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1] [1] -0.128027 > cor(x1[-N], x2[-1]) [1] -0.

Re: [R] problems accessing MS Access 2003 database with RODBC

2010-04-26 Thread Marc Schwartz
On Apr 26, 2010, at 12:40 PM, Marc Schwartz wrote: > On Apr 26, 2010, at 12:11 PM, boris.vasil...@forces.gc.ca wrote: > >> Dear users, >> >> I am trying to access a Microsoft Access database from R using RODBC >> package >> but I have had little success. The setup works with isql, RODBC seems

Re: [R] Sweave: centering with echo=TRUE

2010-04-26 Thread Duncan Murdoch
On 26/04/2010 7:07 AM, David.Epstein wrote: In a .Rnw file I want to insert the R command pairs(mydataframe) and achieve the following effects 1. the command itseld is echoed into the tex document generated by Sweave <>= 2. The graphics generated appears in the tex document, with the graphics ce

Re: [R] R.GBM package

2010-04-26 Thread Ridgeway, Greg
GBM implements boosted trees. It works for 0/1 outcomes, count outcomes, continuous outcomes and a few others. You do not need to combine rpart and gbm. You're best bet is to just load the package and run a demo >demo(bernoulli). From: Changbin Du [mailto:changb..

Re: [R] data frame

2010-04-26 Thread jim holtman
Is this what you want: > x <- read.table(textConnection("variable YEAR VAR + EC01 2006 100 + + EC01 2007 200 + + EC02 2006 5

Re: [R] problems accessing MS Access 2003 database with RODBC

2010-04-26 Thread Marc Schwartz
On Apr 26, 2010, at 12:11 PM, boris.vasil...@forces.gc.ca wrote: > Dear users, > > I am trying to access a Microsoft Access database from R using RODBC > package > but I have had little success. The setup works with isql, RODBC seems > to > connect to the database, but RODBC does not recognize

Re: [R] data frame

2010-04-26 Thread Tal Galili
you can do this: a <- tapply(VAR, YEAR, prod) The use "merge" to create a new variable of the length of your original VAR, and just do VAR/prod.VAR Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read m

[R] help with code

2010-04-26 Thread Randy Cass
I am new to R and have tried for a good while to figure out how to code this in R. The dataset below: FTIStandKey State County FTITract CoverType Ver_CT V_Origin V_SpGrp NAH6005-001 Texas Jasper NAH6005 PPLB-2000-U PPLB-2000-U P P NAH6005-002 Texas Jasp

[R] mvpart : Printing response values at terminal nodes

2010-04-26 Thread S, Manjunath (GE, Research)
I have created a multivariate regression tree using mvpart, with 3-4 responses. Though the plot shows bargraphs for each response, I would like to have the VALUES of the responses printed or indicated (via a scale or something) alongside the bargraph. Is this possible ?? Thanks, Manjunath

Re: [R] Sweave

2010-04-26 Thread Gabor Grothendieck
Sorry, typo. Try this: file.path(R.home(), "share", "texmf", "Sweave.sty") On Mon, Apr 26, 2010 at 1:18 PM, Gabor Grothendieck wrote: > Its at this path (this command is issued from within R): > >   file.path(R.home(), "share", "textmf", "Sweave.sty") > > You can add it to your MiKTeX installati

Re: [R] R.GBM package

2010-04-26 Thread Changbin Du
Thanks so much, Greg! On the demo(bernoulli), I FOUND the following information: IT is used for logistic regression. My question is: when I define a decision tree, can I still use the formula Y~X1+X2+X3,# formula, even though I dont know the detailed formula of decision tree. T

Re: [R] Sweave

2010-04-26 Thread Gabor Grothendieck
Its at this path (this command is issued from within R): file.path(R.home(), "share", "textmf", "Sweave.sty") You can add it to your MiKTeX installation or just put it in the same directory as your Rnw file. On Mon, Apr 26, 2010 at 1:10 PM, Jimmy Söderly wrote: > Hi everybody, > > I wanted

Re: [R] data frame

2010-04-26 Thread Henrique Dallazuanna
Try this: sweep(with(x, tapply(VAR, list(variable, YEAR), FUN = prod)), 2, with(x, tapply(VAR, YEAR, FUN = prod)), FUN = "/") On Mon, Apr 26, 2010 at 12:07 PM, n.via...@libero.it wrote: > > Dear list, > I have a big data frame which looks like this: > variable YEAR

[R] Help with replacement of certain values in dataset with SAS code equivalent

2010-04-26 Thread Randy Cass
I am new to R and have tried for a good while to figure out how to code this in R. The dataset below: FTIStandKey State County FTITract CoverType Ver_CT V_Origin V_SpGrp NAH6005-001 Texas Jasper NAH6005 PPLB-2000-U PPLB-2000-U P P NAH6005-002 Texas Jasp

Re: [R] Sweave

2010-04-26 Thread Sarah Goslee
You'll find that this is a very common question, and 30 seconds with google will get you many nice explanations and solutions. The quickest is to copy Sweave.sty from the package directory to your working directory. Sarah On Mon, Apr 26, 2010 at 1:10 PM, Jimmy Söderly wrote: > Hi everybody, > >

Re: [R] Sweave

2010-04-26 Thread Doran, Harold
If you have the package you have this file. Maybe check FAQ A.12 http://www.stat.uni-muenchen.de/~leisch/Sweave/FAQ.html -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jimmy Söderly Sent: Monday, April 26, 2010 1:10 PM To: r-help

[R] problems accessing MS Access 2003 database with RODBC

2010-04-26 Thread Boris.Vasiliev
Dear users, I am trying to access a Microsoft Access database from R using RODBC package but I have had little success. The setup works with isql, RODBC seems to connect to the database, but RODBC does not recognize the data in the database. Can anybody advise where I am going wrong? I am usi

[R] Sweave

2010-04-26 Thread Jimmy Söderly
Hi everybody, I wanted to use Sweave but I do not have the Latex package: "LaTeX Error: File 'Sweave.sty' not found." I cannot find it with MiKTeX :-( Can somebody help me ? Thanks a lot, Jimmy [[alternative HTML version deleted]] __ R-hel

Re: [R] Finding First of a Type in a Sequence

2010-04-26 Thread David Winsemius
On Apr 26, 2010, at 12:29 PM, Su Chu wrote: Hi there, I am working on a project that requires me to find the point at which values become negative in a sequence about the max. For example, say I have some sequence: x=c(-12, -2,-19, 0, -14, -2, 9,10,20,35,56,89,60,39,12,8,-5,-2,0,10) > x

Re: [R] Finding First of a Type in a Sequence

2010-04-26 Thread Tal Galili
Try this: func <- function(x) { which.negative <- which(x<0) index.to.return <- which.negative[which.negative > which.max(x)][1] return(index.to.return) } func(x) Best, Tal Contact Details:--- Contact me: tal.gal...@gmail.co

[R] R.GBM package

2010-04-26 Thread Changbin Du
HI, Dear Greg, I AM A NEW to GBM package. Can boosting decision tree be implemented in 'gbm' package? Or 'gbm' can only be used for regression? IF can, DO I need to combine the rpart and gbm command? Thanks so much! -- Sincerely, Changbin -- [[alternative HTML version deleted]] _

  1   2   >