Re: [R] new line between '}' and 'else' in function body

2009-04-02 Thread Romain Francois
Hi, That's because the parser knows how to deal with that stuff. However, when you type the same if/else at the command line, it will be parsed line by line, and the evaluator will not wait for the else to evaluate the if. Try to copy and paste your if/else to the command line. Romain Yihu

[R] extract tables as data.frames from HTML source

2009-04-02 Thread Yihui Xie
Hi, I wonder whether there is any convenient function (or package) to extract tables from a HTML page? e.g. from http://www.google.com/finance/historical?q=SHE:002251 I know we can readLines('URL'), gsub('...', '...', source), ... and at last get the numbers; I'm writing to ask whether someone ha

[R] new line between '}' and 'else' in function body

2009-04-02 Thread Yihui Xie
Hi list members, ?"else" tells us In particular, you should not have a newline between '}' and 'else' to avoid a syntax error in entering a 'if ... else' construct at the keyboard or via 'source'. but there's no syntax error when you break the line between "}" and "else" in a func

Re: [R] matrix vectorization or something else??

2009-04-02 Thread Kutlwano Ramaboa
Agree, it is ambiguous. Will try again Suppose I have the following X<-matrix(c(1:20),nrow=4,byrow=T), hence this is a 4 by 5 matrix Y<-matrix(c(2,4,6,8),ncol=1), and this is a 4 by 1 vector, each value denote y1, y2,y3, y4 Step 1 - write each row of X as a vector, so I have vectors t(x_

[R] bigglm "update" with ff

2009-04-02 Thread Yue Sheng
Hi, since bigglm doesn't have update, I was wondering how to achieve something like (similar to the example in ff package manual using biglm): first <- TRUE ffrowapply ({ if (first) { first <- FALSE fit <- bigglm(eqn, as.data.frame(bigdata[i1:i2,,drop=FALSE]), chunksize = 1, family =

Re: [R] Translate C code to R code?

2009-04-02 Thread Jim Silverton
Hello, Can anyone in this group translate what the following C Code is doing? Any help appreciated. Jim: #include #include #include double rtrun(double mu, double sigma,double trunpt, int above) { /* function to draw truncated normal above=1 means from above b=trunpt, a

Re: [R] How to force an point in x-axis to appear in plot

2009-04-02 Thread Rolf Turner
On 3/04/2009, at 4:36 PM, Gundala Viswanath wrote: Dear all, With this snippet: xlim=c(-126000,50) in the current plot, the x-axis appear in the following tick marks: -10, 10, 30, ...etc How can we force a point where x=0 to appear in the plot? Yielding: -10, 0, 10

[R] how to sort and plot data?

2009-04-02 Thread Hemavathi Ramulu
hi, Previously my email very simple and less information. Let say I have raw data as below:- user_id website time 20google0930 21yahoo0935 20facebook1000 25facebook1015 61google0940 60yaho

Re: [R] re trieve R session?

2009-04-02 Thread ronggui
Does load() work? 2009/4/3 purpleshirt : > > I login Linux machine on my windows desktop via Exceed, then run R. > > Somehow my desktop got rebooted by accident, when I re-login, I can see the > R session is still listed there (run >top). My question is, is there any way > I can bring back that R

[R] How to force an point in x-axis to appear in plot

2009-04-02 Thread Gundala Viswanath
Dear all, With this snippet: xlim=c(-126000,50) in the current plot, the x-axis appear  in the following tick marks: -10, 10, 30, ...etc How can we force a point where x=0 to appear in the plot? Yielding: -10, 0, 10, 30, ...etc ^ in the x-axis tick m

Re: [R] In plot.zoo the screens and ylim arguments seem incompatible

2009-04-02 Thread Gabor Grothendieck
Thanks for the bug report. In the interim these two (and variations work): plot(z, screens=c(1,2,2), ylim = c(1, 40)) plot(z, screens=c(1,2,2), ylim = list(c(1, 40), c(1, 40), c(1, 40))) On Thu, Apr 2, 2009 at 3:41 PM, Scott Tennican wrote: > > I am plotting multiple graphs per window with multi

Re: [R] Howto Disable Scientific Numeric in X-axis for Plotting

2009-04-02 Thread Rolf Turner
On 3/04/2009, at 3:47 PM, Gundala Viswanath wrote: Dear all, I have a plot which contain the following parameter: xlim=c(-126000,50) In the actual plot it self the x-axis appear as: -1e+05, 0e+00, 1e+05, 2e+05 ..etc... Is there a way we can disable such representation of x-axis to plai

[R] Howto Disable Scientific Numeric in X-axis for Plotting

2009-04-02 Thread Gundala Viswanath
Dear all, I have a plot which contain the following parameter: xlim=c(-126000,50) In the actual plot it self the x-axis appear as: -1e+05, 0e+00, 1e+05, 2e+05 ..etc... Is there a way we can disable such representation of x-axis to plain number: -10, 0 , 10, 20, ...etc - Gunda

Re: [R] Selecting all rows of factors which have at least one positive value?

2009-04-02 Thread hadley wickham
>   X1 X2 > 1  11  0 > 2  11  0 > 3  11  0 > 4  11  1 > 5  12  0 > 6  12  0 > 7  12  0 > 8  13  0 > 9  13  1 > 10 13  1 > > > and I want to select all rows pertaining to factor levels of X1 for > which exists at least one "1" for X2. To be clear, I want rows 1:4 > (since there exists at least one o

Re: [R] matrix vectorization or something else??

2009-04-02 Thread David Winsemius
Generally unambiguous questions get answered quickly. Perhaps other readers are having the same difficulties I am experiencing. So let's try to parse what you are asking: On Apr 2, 2009, at 8:26 AM, Kutlwano Ramaboa wrote: Hello This may have been answered elsewhere, and I have looked on t

Re: [R] Selecting all rows of factors which have at least one positive value?

2009-04-02 Thread David Winsemius
I think the unique function is superfluous: > x[x$X1 %in% x$X1[x$X2==1], ] X1 X2 1 11 0 2 11 0 3 11 0 4 11 1 8 13 0 9 13 1 10 13 1 -- David Winsemius On Apr 2, 2009, at 12:43 PM, Patrizio Frederic wrote: or the exactly equivalent form: x[x$X1 %in% unique(x[x$X2>0,"X1"]),

[R] Residuals for an Ordered Probit

2009-04-02 Thread Mitch Troup
Hello, I've succeeded in running an ordered probit model, and I am currently trying to perform some diagnostics to determine the appropriateness of my model for the data. I cannot figure out how to get residuals for the ordered probit so that I can plot them against the variables in my mode

[R] re trieve R session?

2009-04-02 Thread purpleshirt
I login Linux machine on my windows desktop via Exceed, then run R. Somehow my desktop got rebooted by accident, when I re-login, I can see the R session is still listed there (run >top). My question is, is there any way I can bring back that R session? Thanks, -- View this message in context:

Re: [R] help with two layers of factors

2009-04-02 Thread David Winsemius
> df <- read.table(textConnection('Experiment_id Treament_type Value + 12345"control"3 + 12345"full treatment"4 + 12345"full treatment"5 + 12345"partial treatment"4 + 1"control"1'), header = TRUE) > df Experiment_id Treament_type Value 1 12

[R] Functions Accessing Databases

2009-04-02 Thread Bob Roberts
Hello, I'm accessing a MySQL database from inside R and had a problem with a function. In the database, there is data from years 1985 to 2007 that I would like to retrieve. I can easily get the data from one year by the following: info1985=dbGetQuery(con, statement='the SQL query') Inside the

Re: [R] Looking for an R advanced programming course in USA

2009-04-02 Thread s...@xlsolutions-corp.com
We're offering advanced course in USA this april. Regards - Sue --- XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce our*** R Advanced Programming***courses at USA locations for March - April 2009. http:

Re: [R] Updating a data frame

2009-04-02 Thread David Winsemius
I am sure this is not the most elegant method, but it will "work". > new <- merge(nn,uu, by = c("a","b"), all.x=T) > new a bx.xy.x x.y y.y 1 1 1 0.03648491 0.69644753 100 -100 2 1 2 0.76826365 0.28821953 NA NA 3 1 3 0.62744363 0.08373154 NA NA 4 2 1 0.27503185 0.557

Re: [R] calculating drop1 R^2s

2009-04-02 Thread John Fox
Dear Michael, How about the following? y <- model.response(model.frame(base.mod)) TSS <- sum((y - mean(y))^2) 1 - drop.mod$RSS/TSS I hope this helps, John > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Michael Friendly >

[R] Updating a data frame

2009-04-02 Thread Seeliger . Curt
Folks, Updating values in a table is simple in SAS or SQL, but I've wracked my brain looking for an elegant solution in R to no avail thus far. Certainly this is a common need that's been solved in dozens of different ways. Given an initial dataframe nn and a smaller dataframe of updates uu, I'

Re: [R] Histogram with lattice with two 'conditional' variables

2009-04-02 Thread Deepayan Sarkar
On Thu, Apr 2, 2009 at 3:16 PM, Judith Flores wrote: > > Hello dear R-community, > >    I have been trying to figure out a way to generate histograms of a numeric > variable observed in different entities ('individual' below). Each one of > this entities is classified as "A" or "B" (according to

[R] Histogram with lattice with two 'conditional' variables

2009-04-02 Thread Judith Flores
Hello dear R-community, I have been trying to figure out a way to generate histograms of a numeric variable observed in different entities ('individual' below). Each one of this entities is classified as "A" or "B" (according to the pseudo-code below): variable<-sample(rep(1:10,10)) indiv

[R] calculating drop1 R^2s

2009-04-02 Thread Michael Friendly
This is probably simple, but I just can't see it... I want to calculate the R^2s for a series of linear models where each term is dropped in turn. I can get the RSS from drop1(), and the r.squared from summary() for a given model, but don't know how to use the result of drop1() to get the r.s

Re: [R] Deleting rows based on identity variable

2009-04-02 Thread baptiste auguie
just for curiosity, `%ni%` <- Negate(`%in%`) > 1 %ni% c(2,1) [1] FALSE d1[id %ni% c(1,4), ] baptiste On 2 Apr 2009, at 22:17, gina patel wrote: I have another question, if I now want to remove multiple id's e.g. id=1 or 4 is there a simple OR command I can use? I tried d2<-(d1[id != 1 |

Re: [R] Deleting rows based on identity variable

2009-04-02 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of gina patel > Sent: Thursday, April 02, 2009 2:17 PM > To: Brian Lee Yung (Portfolio Analytics)Rowe; hadley wickham > Cc: R-help@r-project.org > Subject: Re: [R] Deleting rows based

Re: [R] Deleting rows based on identity variable

2009-04-02 Thread Rolf Turner
On 3/04/2009, at 9:30 AM, gina patel wrote: I have created this data frame to help illustrate my problem. id<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5)) x<-rep((seq(1:5)),5) y<-c(0, 0.1, 0.5, 0.4, 0.2, 0, 0.1, 0.5, 0.4, 0.12, 0, 0.1, 0.5, 0.55, 0.2, 0, 0.1, 0.5, 0.3, 0.2, 0, 0.1, 0.6, 0

Re: [R] Deleting rows based on identity variable

2009-04-02 Thread gina patel
I have another question, if I now want to remove multiple id's e.g. id=1 or 4 is there a simple OR command I can use? I tried  d2<-(d1[id != 1 | 4, ]) however this does not delete anything PS  d2<-(d1[id != 4, ]) worked to remove id=4 Thanks Gina --- On Thu, 4/2/09, hadley wickham wrote: F

Re: [R] Installation of all packages under Unix

2009-04-02 Thread Bernardo Rangel Tura
On Thu, 2009-04-02 at 14:37 +0200, nboe...@uni-potsdam.de wrote: > Dear List-Members, > > does anyone know a simple way to automatically install all R packages > on a unix system to the default library path? Not from inside R, it > should rather work as a shell script - job at startup. > > So

Re: [R] Deleting rows based on identity variable

2009-04-02 Thread hadley wickham
On Thu, Apr 2, 2009 at 3:37 PM, Rowe, Brian Lee Yung (Portfolio Analytics) wrote: > Is this what you want: >> d1[which(id != 4),] Or just d1[id != 4, ] Hadley -- http://had.co.nz/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

Re: [R] Deleting rows based on identity variable

2009-04-02 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
Is this what you want: > d1[which(id != 4),] id xy [1,] 1 1 0.00 [2,] 1 2 0.10 [3,] 1 3 0.50 [4,] 1 4 0.40 [5,] 1 5 0.20 [6,] 2 1 0.00 [7,] 2 2 0.10 [8,] 2 3 0.50 [9,] 2 4 0.40 [10,] 2 5 0.12 [11,] 3 1 0.00 [12,] 3 2 0.10 [13,] 3 3 0.50 [14,] 3 4 0.55 [15,] 3 5 0.2

[R] In plot.zoo the screens and ylim arguments seem incompatible

2009-04-02 Thread Scott Tennican
I am plotting multiple graphs per window with multiple series on each graph. When I try to set ylim I get the error below: Error in ylim[[idx]] : subscript out of bounds Am I incorrectly specifying my ylim list or is this a bug? Here is a simple reproduction: z <- zoo(cbind(a = 1:10, b = 11:20,

[R] Deleting rows based on identity variable

2009-04-02 Thread gina patel
I have created this data frame to help illustrate my problem. id<-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5)) x<-rep((seq(1:5)),5) y<-c(0, 0.1, 0.5, 0.4, 0.2, 0, 0.1, 0.5, 0.4, 0.12, 0, 0.1, 0.5, 0.55, 0.2, 0, 0.1, 0.5, 0.3, 0.2, 0, 0.1, 0.6, 0.4, 0.1) d1<-cbind(id,x,y) I would like to delet

Re: [R] Installation of all packages under Unix

2009-04-02 Thread Paul Hiemstra
nboe...@uni-potsdam.de schreef: Dear List-Members, does anyone know a simple way to automatically install all R packages on a unix system to the default library path? Not from inside R, it should rather work as a shell script - job at startup. Something like R cmd install -l pkgs ### where p

Re: [R] Sweave, using xtable in a loop doesnt work?

2009-04-02 Thread Paul Hiemstra
Stacey Burrows schreef: I have a data.frame, data, with 30 factor variables. I would like to tabulate the frequencies of each variable and output to a tex file using Sweave. Here is my code chunk: <>= library(xtable) for(j in 1:30){ cap <- paste("Frequency counts for Q",j,".", sep="") xtab

[R] Looking for an R advanced programming course in USA

2009-04-02 Thread steve Jones
Hi List, I am looking for an R advanced programming course in USA for April. Need to attend the course before April 31st. Regards - Steve [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

[R] Sweave, using xtable in a loop doesnt work?

2009-04-02 Thread Stacey Burrows
I have a data.frame, data, with 30 factor variables. I would like to tabulate the frequencies of each variable and output to a tex file using Sweave. Here is my code chunk: <>= library(xtable) for(j in 1:30){   cap <- paste("Frequency counts for Q",j,".", sep="")   xtable(t(table(data[,j])),capt

Re: [R] A question about forecasting with R

2009-04-02 Thread Rolf Turner
On 2/04/2009, at 11:27 PM, Uwe Ligges wrote: Not many of us are clairvoyants Hey! Wish I'd said that! :-) cheers, Rolf P. S. Great minds think alike. R. ###

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Florin Maican
Ravi, You are right. I did not specified the type of problem: large problems with smooth functions and not large-scale discrete problems. I am sorry for confusion. For non-smooth functions, I can suggest subplex. http://cran.r-project.org/web/packages/subplex/index.html Florin On Thu, 2 A

Re: [R] [R-sig-Geo] Time series analysis with irregular time-series

2009-04-02 Thread Ben Fissel
Hello Wesely, The appropriate way to address irregular time series depends on what want to use the estimates for. If your objective is to estimate the times that you don't observe (interpolate) then a natural cubic spline is a good method to provide such an estimate. If your objective is to obta

Re: [R] Matrix multiplication - code problem

2009-04-02 Thread Ben Bolker
I think this works in general, although it's a little bit clunky: id_y <- array(1:10,dim=c(2,1,5)) id_yt <- aperm(id_y,c(2,1,3)) m_id <- array(dim=c(dim(id_y)[1],dim(id_y)[1],dim(id_y)[3])) for (i in 1:dim(id_y)[3]){ m1 <- array(id_y[,,i],dim=dim(id_y)[1:2]) m2 <- array(id_yt[,,i],dim=di

Re: [R] Function?

2009-04-02 Thread Patrick Burns
Would your blood still circulate if you take off your heart? That is, the answer is, "No, that's where the work is done in the function." If you want to understand the computations that function is doing, then you need to examine the C code that it is calling. Patrick Burns patr...@burns-stat.

Re: [R] Matrix multiplication - code problem

2009-04-02 Thread Patrick Burns
You need to put in calls to 'as.matrix'. It's a bit tricky though -- what you want depends on whether it is the first or second subscript that has length 1. as.matrix(id_y[,,i]) if the second dimension has length 1. t(as.matrix(id_y[,,i])) if the first dimension has length 1. Patrick Burns

[R] multiple annotations on a heatmap

2009-04-02 Thread Levi Waldron
Can someone recommend a more sophisticated way to annotate heatmaps than the ColSideColors argument of heatmap and heatmap.2? In particular, I would like to be able to annotate columns with more than one piece of information, like in Figure 1 of the article at http://www3.interscience.wiley.com/cg

Re: [R] Lattice axis list (when relation = "free")

2009-04-02 Thread Deepayan Sarkar
On 4/2/09, In Hee Park wrote: > Thanks for your comment. Beside axis location, I have another > question for you. > > If I wanted to change the matrix column names shown on the lattice > plot, which argument should be used to handle it? (I'd like to know > the overall lattice plot level sche

[R] help with two layers of factors

2009-04-02 Thread haettulegur
I have a data frame that looks something like... Column 1 is an experiment_id, Column 2 is the type of treatment ("control", "full treatment", or "partial treatment"), and Column 3 is a value. Experiment_id Treament_type Value 12345"control"3 12345"full treatment"4 12345"full

Re: [R] Lattice axis list (when relation = "free")

2009-04-02 Thread In Hee Park
Thanks for your comment. Beside axis location, I have another question for you. If I wanted to change the matrix column names shown on the lattice plot, which argument should be used to handle it? (I'd like to know the overall lattice plot level scheme, for example, which argument controls which

[R] problem with svyglm()

2009-04-02 Thread Federico Calboli
Hello, I'm trying to use the function svyglm in the library survey. I create a data survey object: data_svy<- svydesign(id=~PSU, strata=~sample_domain, weights=~sample_weight, data=data, nest=TRUE) and I try to use svyglm() with little success: R<-svyglm(data_svy[,4]~(data_svy[,iCol]==listMo

Re: [R] help with ggplot2 -- ggpoint function missing?

2009-04-02 Thread Edwin Chen
Thanks, that helped! I didn't realize there was another version of the book. On Wed, Apr 1, 2009 at 2:51 PM, Tobias Verbeke < tobias.verb...@openanalytics.be> wrote: > Hi, > > I'm trying to follow the ggplot introduction here: >> http://had.co.nz/ggplot/ggplot-introduction.pdf >> >> I've install

Re: [R] help with ggplot2 -- ggpoint function missing?

2009-04-02 Thread Steve_Friedman
I tried the example in ggplot as well and rec'd the same error message. ggpoint is not found in the ggplot2 library. Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (3

Re: [R] Selecting all rows of factors which have at least one positive value?

2009-04-02 Thread Patrizio Frederic
or the exactly equivalent form: x[x$X1 %in% unique(x[x$X2>0,"X1"]), ] Patrizio 2009/4/2 Nutter, Benjamin : > x <- > data.frame(matrix(c(rep(11,4),rep(12,3),rep(13,3),rep(0,3),1,rep(0,4),re > p(1,2)),ncol=2)) > > id.keep <- unique(subset(x,X2>0)$X1) > > x2 <- subset(x,X1 %in% id.keep) > > x2 > >

Re: [R] Function?

2009-04-02 Thread Jim Silverton
Hello all, I am looking at the one program of the marketing textbook. I understand what the following function is doing especially the .C command Can someone help? If I take off the .C comand will it still run?? drawwc = function(w, mu, y, sigi) { .C("draww", w = as.double(w), as.double

[R] finding best fitting model

2009-04-02 Thread Benedikt Niesterok
Hello, Is there a function in r to find the best fitting model for a set of data? I would like to know if my data are related exponentially,linearly or if there is a logarithmic correlation between my x and y values. To get a better imagination I've added the graphics at the end of this mail as an

Re: [R] all subsets for glm

2009-04-02 Thread Dieter Menne
Harald von Waldow wrote: > > For the purpose of model selection I am looking for a way to > exhaustively (and efficiently) search for best subsets of predictor > variables for a logistic regression model. > Of all the dangerous ways of doing this and getting confusing results, gl1ce in lasso2

Re: [R] Lattice axis list (when relation = "free")

2009-04-02 Thread Deepayan Sarkar
On 3/29/09, In Hee Park wrote: > Dear R users: > > > I am having difficulty to place x-axis location alternatively > top/bottom side in Lattice plot, which is composed of seven-column as > following: > > E1 E2 E3 E4 E5 E6 E7 > Case1 -505.85 -75.32

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Paul Smith
On Thu, Apr 2, 2009 at 3:49 PM, wrote: > Sorry I sent a description of the function I was trying to minimize but I > must not have sent it to this group (and you). Hopefully with this clearer > description of my problem you might have some suggestions. > > It is basically a warehouse placement

Re: [R] Matrix multiplication - code problem

2009-04-02 Thread MarcioRibeiro
Hi again, I understood what you guys explained... But, there isn't a way to do a multiplication of matrix with a FOR command or otherelse where one o my dimension is ONE... Well, as my data file is small, I did the procedure at the excel... But, this is not the good procedure... Thanks, Marcio U

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Ravi Varadhan
Florin, Please allow me to clarify some issues: Many, if not most, problems in science involve optimization in one form or another. Consequently, "optimization" is a vast area. There are many different types of optimization. Here is a one way to classify optimzation problems (neither mutually

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Ben Bolker
Just a quick thought: if you have the locations of the items along a line segment (the "warehouse"), can you find a way to formulate the problem so that the average distances represent a matrix calculation (i.e., multiply some huge matrix by the locations) then it's a linear problem ... It's t

Re: [R] Selecting all rows of factors which have at least one positive value?

2009-04-02 Thread Nutter, Benjamin
x <- data.frame(matrix(c(rep(11,4),rep(12,3),rep(13,3),rep(0,3),1,rep(0,4),re p(1,2)),ncol=2)) id.keep <- unique(subset(x,X2>0)$X1) x2 <- subset(x,X1 %in% id.keep) x2 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Stephan Lindner

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Florin Maican
I tried many optimizers in R on my large scale optimization problems. I am not satisfied with their speed on large op problems. But you may try in this order nlminb ucminfucminf package spq BB package optim Is here someone that try to port Ipopt in R? https://projects.co

[R] [R} seasonal differencing

2009-04-02 Thread Joseph Magagnoli
Hi all, I was wondering how to construct a seasonal differenced time series variable. I used the following code to construct a 12 span seasonal difference seasonal<-diff(V2, lag=12, differences=1) is this correct? thank you in advance joe [[alternative HTML version deleted]] __

[R] Selecting all rows of factors which have at least one positive value?

2009-04-02 Thread Stephan Lindner
Dear all, I'm trying to select from a dataframe all rows which correspond to a factor (the id variable) for which there exists at least one positive value of a certain variable. As an example: x <- data.frame(matrix(c(rep(11,4),rep(12,3),rep(13,3),rep(0,3),1,rep(0,4),rep(1,2)),ncol=2)) > x

[R] all subsets for glm

2009-04-02 Thread Harald von Waldow
Dear R-users, For the purpose of model selection I am looking for a way to exhaustively (and efficiently) search for best subsets of predictor variables for a logistic regression model. I am looking for something like leaps() but that works with glm. Any feedback highly appreciated. -- Harald

[R] Installation of all packages under Unix

2009-04-02 Thread nboehme
Dear List-Members, does anyone know a simple way to automatically install all R packages on a unix system to the default library path? Not from inside R, it should rather work as a shell script - job at startup. Something like R cmd install -l pkgs ### where pkgs should mean all packages

[R] USING MULTILEVEL PACKAGE AND WABA FUNCTION

2009-04-02 Thread Analisi Dati
Dear friends, this time I have a problem with using waba function. Firstly, I'll explain you my situation. In the survey a gruop of supervisors judge the dipendents of a company. One supervisor reported on more than one subordinate. Thus, I need to show that lack of independence is not a problem

Re: [R] CORRECTION: Re: Multicollinearity with brglm?

2009-04-02 Thread Ioannis Kosmidis
Thanks for your mail. I guess that the constant row sum on X would create problems in a simulation framework because you might end up with linearly dependent columns or even with columns of zeros (which I believe do not make much sense). First of all, I think there is a problem with your examp

Re: [R] Constrined dependent optimization.

2009-04-02 Thread rkevinburton
Sorry I sent a description of the function I was trying to minimize but I must not have sent it to this group (and you). Hopefully with this clearer description of my problem you might have some suggestions. It is basically a warehouse placement problem. You have a warehouse that has many item

Re: [R] help with ggplot2 -- ggpoint function missing?

2009-04-02 Thread Felipe Carrillo
Did you load the package after installing it? install.packages("ggplot2") library(ggplot2) Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA --- On Wed, 4/1/09, haettulegur wrote: > From: haettulegur > Subject: [R]

Re: [R] Programming objects in R

2009-04-02 Thread James W. MacDonald
While not wholly directed towards OO programming, 'R Programming for Bioinformatics' does cover both the S3 and S4 systems (and how to make them play nicely together) at an accessible level. http://www.bioconductor.org/pub/RBioinf/ Best, Jim Krzysztof Sakrejda-Leavitt wrote: Tom Backer Jo

Re: [R] Programming objects in R

2009-04-02 Thread Krzysztof Sakrejda-Leavitt
Tom Backer Johnsen wrote: This is interesting. The fact that there are so few texts on the subject probably means that very few are using OO programming methods in R. That's overstating the problem. I frequently run into OO R packages and many of them are very nicely done. Some good example

Re: [R] SNOW: Error in socketSelect(socklist) : not a socket connection

2009-04-02 Thread luke
Your R version seems to be out of date. This would happen in older versions of R, prior to 2.8.0 I believe, due to a bug in socketSelect that was fixed last August. luke On Wed, 1 Apr 2009, Ubuntu Diego wrote: I'm trying to use snow in my dual-core (hopefully later this is going to run in a c

Re: [R] Programming objects in R

2009-04-02 Thread Tom Backer Johnsen
Wacek Kusnierczyk wrote: Tom Backer Johnsen wrote: This is interesting. The fact that there are so few texts on the subject probably means that very few are using OO programming methods in R. I will probably look in the Python direction. Pity. I would have preferred R. if you insist on oo

Re: [R] Programming objects in R

2009-04-02 Thread Martin Morgan
Tom Backer Johnsen writes: > This is interesting. The fact that there are so few texts on the > subject probably means that very few are using OO programming methods > in R. Using python is great; your deduction about use of OO in R harder to support. The Bioconductor project (300+ packages, no

Re: [R] Programming objects in R

2009-04-02 Thread Wacek Kusnierczyk
Tom Backer Johnsen wrote: > This is interesting. The fact that there are so few texts on the > subject probably means that very few are using OO programming methods > in R. > > I will probably look in the Python direction. Pity. I would have > preferred R. > if you insist on oo, python might be

[R] Calculating Modal value and huge dataset

2009-04-02 Thread Rainer M Krug
I have a data.frame y as below, and I want to calculate the "weighted modal value", where v... are the values, and w... are the weights. At tha moment I am doing it as shown below, but my data.frame has 165900 and more rows, and it takes ages to do the calculations. I am sure there is a much better

Re: [R] Programming objects in R

2009-04-02 Thread Tom Backer Johnsen
This is interesting. The fact that there are so few texts on the subject probably means that very few are using OO programming methods in R. I will probably look in the Python direction. Pity. I would have preferred R. Tom krzysztof.sakre...@gmail.com wrote: I have been using Chambers f

Re: [R] Plotting multiple ablines

2009-04-02 Thread r...@quantide.com
May be: plot(c(-1, 1) , c(-1, 1), type = "n") n = 4 a = rep(0, n) b = 1:n/n fun = function(i, a, b, col = 1 , ...) { abline(a[i], b[i], col = col[i], ...) } lapply(1:n, fun, a=a, b=b, col = 1:n) Andrea Thomas Levine wrote: I really want to do this: abline( a=tan(-kT*pi/180), b=kY-tan(-

[R] matrix vectorization or something else??

2009-04-02 Thread Kutlwano Ramaboa
Hello This may have been answered elsewhere, and I have looked on the web, but nothing helps. I am trying to do the following: X<-matrix(c(1:15),nrow=3,byrow=T) Y<-matrix(c(2,4,6,8,10),ncol=1) I need to sum the product of each row of X by the remaining j rows multiplied by j y values (i.e s

Re: [R] Environments

2009-04-02 Thread Bill.Venables
What you are trying to do is make R behave like a macro language, which is not a good idea at all. Better to use R as it was designed to be used rather than make it behave like something it wasn't. It also follows that trying to do this is going to be tricky. Here is one way: RENAME <- functi

Re: [R] How to specify axis interval unit...

2009-04-02 Thread V Prasanth
Dear R Users: Greetings! Finally, I got what I required...! Thanks a lot for all of your valuable support, especially to Jim and Duncan Murdoch. Great help guys... By the way, herewith I am furnishing the code that I used for adjusting the axis interval unit... Hope it will be useful to others, a

Re: [R] CORRECTION: Re: Multicollinearity with brglm?

2009-04-02 Thread woodbomb
Ioannis, Here's an illustrative example. Note that: glm also objects to X4; X1,..,X4 are defined as factors. I've looked (albeit in a crude way) at various examples using the perturb package and it seems to confirm that X4 is the source of multicollinearity. As I say, I think the constant row-su

Re: [R] A query about na.omit

2009-04-02 Thread Jose Iparraguirre D'Elia
Mark, Ted, Gabor, Thanks for all your input. José -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 01 April 2009 18:12 To: Jose Iparraguirre D'Elia Cc: r-help@r-project.org Subject: Re: [R] A query about na.omit First input the data frame: > Lines <- "

Re: [R] Add missing values/timestamps

2009-04-02 Thread Gabor Grothendieck
Try this where we read in a zoo series and then merge it with a zero width regularly spaced series to create the result. Lines <- "V1,V2 2008-10-14 08:45:00,94411.08 2008-10-14 08:50:00,90745.45 2008-10-14 08:55:00,82963.35 2008-10-14 09:00:00,75684.38 2008-10-14 09:05:00,78931.82 2008-10-14 09:20

[R] [tcl] unknown color name "red" errors

2009-04-02 Thread Ken-JP
I am running on 64-bit Ubuntu, R version 2.8.1 If I do anything Tcl/Tk related like: > library( Rcmdr ) or > available.packages() I get the error: Error in structure(.External("dotTclObjv", objv, PACKAGE="tcltk"), class = "tclObj") : [tcl] unknown color name "red" --

Re: [R] Retrieving the context

2009-04-02 Thread Uwe Ligges
Example: see_context <- function(word, data, context) { dat <- data$strings temp <- grep(paste("^", word, "$", sep=""), dat) if(length(temp)) index <- lapply(temp, function(x) seq(max(0, x - context), min(x + context, length(dat sapply(index, function(x) paste(dat[x]

Re: [R] Environments

2009-04-02 Thread Hans-Peter Suter
>> rename(x,"C","Z") > x <- rename(x,"C","Z") > x A B Z D 1 2 3 4 -- Regards, Hans-Peter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html an

Re: [R] Add missing values/timestamps

2009-04-02 Thread Uwe Ligges
j.k wrote: Hello alltogheter, I have the following problem and maybe someone can help me with it. I have a list of values with times. They look like that: V1 V2 1 2008-10-14 08:45:00 94411.08 2 2008-10-14 08:50:00 90745.45 3 2008-10-14 08:55:00 82963.35

Re: [R] How do I add a rug to a 3d 'persp' plot?

2009-04-02 Thread Uwe Ligges
RJCallahan wrote: Hi all, I have a (hopefully quick) question. I've got a fascinating set of fitted surfaces in three dimensions corresponding to local linear multiple regressions. I'd like to add rugs to the X and Y axes (corresponding to my independent variables) in order to get a sense for

Re: [R] About the proportion of data

2009-04-02 Thread Uwe Ligges
Tammy Ma wrote: Hi, All. I have scatterplot in 2-D I'd like to see which proportion of data goes into a range. How shall I figure it out? Perhaps some accumulative graph or something? See ?hist and it argument breaks as well as ?cut Uwe Ligges Kind regards, Tammy ___

Re: [R] Matrix multiplication - code problem

2009-04-02 Thread Uwe Ligges
MarcioRibeiro wrote: Hi listers, I am having some trouble in a matrix multiplication... I have already checked some posts, but I didn't find my problem... I have the following code... But I am not getting the right multiplication... I checked the dimension and they are fine... id_y <- array(1:

Re: [R] A question about forecasting with R

2009-04-02 Thread Gabor Grothendieck
The forecast package has a number of forecasting methods you could try. On Thu, Apr 2, 2009 at 3:17 AM, minben wrote: > I want to forecaste the call number everyday for a call-center. Now I > have removed the influence of the fluctuation with some method, so > only thing left is to analyze the tr

Re: [R] problems with package tutorial

2009-04-02 Thread Uwe Ligges
You have so many strange special characters (including different quotes at strange places) below, that it is impossible to find out anything. If you are using the same editor you are writing your e-mails with, I am sure you will have diverse problems with your code Uwe Ligges markle..

[R] Odp: how to sort and group the data?

2009-04-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.04.2009 11:14:34: > HI, > I need help.. > How to sort and group the data below:- > USER NAME > 12 admin > 12 admin > 10 admin > 10 advertising > 61 process > 17snapshot > 61ticket > 61ticket > 30snapshot > 10adv

Re: [R] help regarding converting the available date in "right" date

2009-04-02 Thread Uwe Ligges
I have answered almost the same question a few minutes ago. Why do you send questions more than once? It won't make responses quicker but will confuse people who spend their time in answering messages who do not see that the questions is already answered in another thread Uwe Ligges

Re: [R] A question about forecasting with R

2009-04-02 Thread Uwe Ligges
a) This is the *R-help* mailing list. If you want others to make your data analyses, there are consultants around ... b) If you still want help from the list, follow the posting guide and provide relevant information such as some insight to your data. Not many of us are clairvoyants and hence

[R] help regarding converting the available date in "right" date

2009-04-02 Thread Suresh_FSFM
Dear R users, I have a table with say three columns and 70 rows. The second column has dates in format dd.mm.yy (i.e. 01.10.07 indicating record for October 1, 2007). I read the text file, containing the records. Now, I want to find out the weekday for each date. However, I cannot do so. 1)

  1   2   >