[R] prediction, gam, mgcv

2005-02-27 Thread gabriele . accetta
I fitted a GAM model with Poisson distribution using the function gam() in the mgcv package. My model is of the form: mod-gam(y~s(x0)+s(x1)+s(x2),family=poisson). To extract estimates at a specified set of covariate values I used the gam `predict' method. But I want to get estimate and

Re: [R] Sweave and \input or \include LaTeX commands

2005-02-27 Thread Gorjanc Gregor
Gabor, can you say this in some other way. I appologize, but I just don't understand anything. I really don't see any connection with R CMD CHECK and vignettes. I would just like to see that Sweave would follow \input of \include commands of LaTeX. You can try with the following example bellow.

[R] subsetting data set dimenion problem

2005-02-27 Thread Clint Harshaw
(See DAAG book, p. 173, ex. 3) I'm a new user of R, and I'm following the DAAG text. I want to create a subset of the races2000 data frame, but get errors because of a mismatch of values in some columns: library(DAAG) attach(races2000) hills2000 - races2000[races2000$type == 'hill'] Error in

Re: [R] subsetting data set dimenion problem

2005-02-27 Thread Chuck Cleland
Clint Harshaw wrote: (See DAAG book, p. 173, ex. 3) I'm a new user of R, and I'm following the DAAG text. I want to create a subset of the races2000 data frame, but get errors because of a mismatch of values in some columns: library(DAAG) attach(races2000) hills2000 -

Re: [R] Sweave and \input or \include LaTeX commands

2005-02-27 Thread Friedrich . Leisch
On Sun, 27 Feb 2005 12:32:44 + (UTC), Gabor Grothendieck (GG) wrote: [...] Since this might not be desirable in all instances, if Sweave were to have an include facility then it should not be implemented in such a way that the latex include facility can no longer be used. The

Re: [R] Getting tick positions

2005-02-27 Thread Uwe Ligges
Jim Lemon wrote: Thanks for the answers - I should have been more specific as I had already tried axTicks and pretty. The function in question is gantt.chart() in the latest plotrix package (Thanks to Scott Waichler for the original code). I settled on axis.POSIXct as it seemed the most

[R] Finding Equal Elements in Vectors

2005-02-27 Thread Sven C. Koehler
Hello! I have two vectors and want to know how many of their elements are equal - what's the best way to do this in R? Best regards, Sven __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] POSIXct bug?

2005-02-27 Thread Spencer Graves
Hi, Gabor: Of course: time zone vs. GMT. Next question: Might a simple example that illustrates this be added to the help file for as.POSIXct, and if yes, what should be done to make that happen? Thanks. spencer graves Gabor Grothendieck wrote: Spencer Graves

Re: [R] Finding Equal Elements in Vectors

2005-02-27 Thread Spencer Graves
It depends on what you mean by that. Consider the following two examples: sum((1:5)==(5:1)) [1] 1 sum((2:1) %in%(1:6)) [1] 2 Does one of these solve your problem? spencer graves Sven C. Koehler wrote: Hello! I have two vectors and want to know how many of their elements

Re: [R] Finding Equal Elements in Vectors

2005-02-27 Thread Marc Schwartz
On Sun, 2005-02-27 at 16:07 +0100, Sven C. Koehler wrote: Hello! I have two vectors and want to know how many of their elements are equal - what's the best way to do this in R? Best regards, Sven a - 1:10 b - 8:20 a [1] 1 2 3 4 5 6 7 8 9 10 b [1] 8 9 10 11 12 13

Re: [R] Finding Equal Elements in Vectors

2005-02-27 Thread Marc Schwartz
After I hit send, I realized an error in: which(a %in% b) [1] 8 9 10 The above should be: a[which(a %in% b)] [1] 8 9 10 They happen to be the same by coincidence only, given the values that I used. The first syntax returns the _indices_ of the matches, not the actual matched values

[R] Help with constrained optimization

2005-02-27 Thread Vicky Landsman
Dear all, I need an advice in the following problem. I have to maximize two functions of the form f1(x)=f(y1,x,alpha1,beta1) and f2(x)=(y2,x,alpha2,beta2), the maximization is with respect to alpha1, alpha2, beta1, beta2. I can maximize each function separately using nlm. The problem is that

[R] download files through secure http (HTTPS)

2005-02-27 Thread bogdan romocea
Dear useRs, I'm trying to download some data through the HTTPS protocol. However, download.file() does not support HTTPS (R 2.0.1 on WinXP): Error in download.file(https.url, destfile = test.txt) : unsupported URL scheme 1. Is there any other function/package in R that can work with

Re: [R] Finding Equal Elements in Vectors

2005-02-27 Thread Marc Schwartz
On Sun, 2005-02-27 at 09:50 -0600, Marc Schwartz wrote: [snip] a[which(a %in% b)] [1] 12 13 14 15 One more time: The above can be simplified to just: a[a %in% b] [1] 12 13 14 15 Also, if you happen to be comparing floating point numbers in the two vectors, consider that floating point

Re: [R] Help with constrained optimization

2005-02-27 Thread Spencer Graves
You say that the total number of parameters is approximately 30, but you identify only 4, alpha1, alpha2, beta1 and beta2. I gather these are vectors and g is a scalar? Have you considered making the constraint part of the objective function, so you minimize

Re: [R] Help with constrained optimization

2005-02-27 Thread Spencer Graves
1. I have not used nlm, but I would think for many problems, it would be roughly equivalent to optim. 2. The parameter a in the objective function I wrote was the relative weight between optimization of f1 and f2. I would expect to get different answer with a = 0.5, 1, 2, though I

[R] Writing as matrix

2005-02-27 Thread Srinivas Iyyer
Dear Group, I am calculating correlation coeff. between two populations. After calculating the cor.coefs I want to represent them as a matrix file. a b c d A 1 0 1 1 B 1 1 1 1 C 1 0 1 0 D 0 1 1 1 could any one please help me how can i acheive this:

[R] searching through a matrix

2005-02-27 Thread Jessica Higgs
I am trying to search through a matrix I have (x) to see if there are any missing values. This is what I have been using: for (i in 1:3455) for (j in 1:24) if (is.na(x[i,j])) break; i j When I run the program, it either freezes or stops and returns the last entry in the matrix

Re: [R] searching through a matrix

2005-02-27 Thread Spencer Graves
Does the following solve your problem: is.na(array(c(NA, 1:5), dim=c(2,3))) [,1] [,2] [,3] [1,] TRUE FALSE FALSE [2,] FALSE FALSE FALSE spencer graves Jessica Higgs wrote: I am trying to search through a matrix I have (x) to see if there are any missing values. This is what I

Re: [R] Writing as matrix

2005-02-27 Thread Spencer Graves
What version of R under which operating system? I just tried something similar and got something sensible, as follows: set.seed(1) e1 - array(1:6, dim=c(3,2), dimnames=list(NULL, LETTERS[1:2])) e2 - array(rnorm(6), dim=c(3,2), dimnames=list(NULL, letters[1:2])) e12 - cor(e1,

[R] 3d scatterplots of more than 1 data set

2005-02-27 Thread Saurav Pathak
hi, i am need to plot two or more sets of data in a 3d scatterplot, each set with different color. i tried Rcmdr, and the 3d scatterplot facility, based on rgl. that is what i need. but i cannot seem to code different sets of data differently. any help will be very helpful. i tried