Re: [R] Fourier Analysis and Curve Fitting in R

2008-01-28 Thread Spencer Graves
The 'fda' package supports fitting finite Fourier series with examples in 'canadian-weather.R' and 'gait.R' in the 'demo' subdirectory of '~R\library\fda\fda'; see also 'fda-ch01.R' in the 'scripts' subdirectory. Also, the 'percur' funcction in the 'DierckxSpline' package supports fitting per

Re: [R] add/subtract matrices, ignoring NA or missing values

2008-01-28 Thread Gabor Grothendieck
Perhaps you could explain the motivation behind this. At any rate here are three different solutions: ifelse(is.na(m1), ifelse(is.na(m2), NA, m2), ifelse(is.na(m2), m1, m1 + m2)) apply(array(c(m1, m2), c(2,2,2)), 1:2, function(x) sum(c(na.omit(x), NA)[1])) na.m1 <- is.na(m1) na.m2 <- is.na(m2)

[R] heatmap and legend

2008-01-28 Thread Ng Stanley
Hi, This should be elementary, but I can't find any resource on creating a legend for heatmap. Please help. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

[R] Using Predict and GLM

2008-01-28 Thread Sherri Rose
Dear R Help, I read through the archives pretty extensively before sending this email, as it seemed there were several threads on using predict with GLM. However, while my issue is similar to previous posts (cannot get it to predict using new data), none of the suggested fixes are working

Re: [R] Using Predict and GLM

2008-01-28 Thread Bill.Venables
Your problem is that your newdata data frame only specifies what the value for A is in the predictions. The values for W1 and W2 are unspecified. To predict from fitted models, you need to specify the values you wish to use for *all* the predictor variables, not just the one (I presume) is differ

[R] NLMINB convergence codes

2008-01-28 Thread Rebecca Sela
According to the R documentation for NLMINB, the returned value of convergence is 0 for successful convergence. When I got another code (1), I looked up the PDF that linked from the documentation (http://netlib.bell-labs.com/cm/cs/cstr/153.pdf), which said that a return code under 3 was imposs

[R] error message + boot library

2008-01-28 Thread Pedro Mardones
Dear all; What can be wrong with this simple example? library(boot) d1<-c(rnorm(10,mean=10)) fm<-function(d,i) mean(d[i]) bd1<-boot(d1,fm,1) > Error: evaluation nested too deeply: infinite recursion / > options(expressions=)? Thanks for any idea ___

Re: [R] error message + boot library

2008-01-28 Thread Benilton Carvalho
I wonder what your sessionInfo() is... I copied and pasted your example and could not reproduce the problem (ie, worked just fine). b On Jan 29, 2008, at 12:27 AM, Pedro Mardones wrote: Dear all; What can be wrong with this simple example? library(boot) d1<-c(rnorm(10,mean=10)) fm<-funct

Re: [R] Using Predict and GLM

2008-01-28 Thread Prof Brian Ripley
On Mon, 28 Jan 2008, Sherri Rose wrote: > Dear R Help, > > I read through the archives pretty extensively before sending this > email, as it seemed there were several threads on using predict with > GLM. However, while my issue is similar to previous posts (cannot > get it to predict using new da

Re: [R] error message + boot library

2008-01-28 Thread Prof Brian Ripley
On Tue, 29 Jan 2008, Pedro Mardones wrote: > Dear all; > > What can be wrong with this simple example? > > library(boot) > d1<-c(rnorm(10,mean=10)) > fm<-function(d,i) mean(d[i]) > bd1<-boot(d1,fm,1) > >> Error: evaluation nested too deeply: infinite recursion / >> options(expressions=)? Let

[R] error bar ploting problem with 'arrows' function

2008-01-28 Thread Yogesh Tiwari
Hello, I used 'arrows' function to plot the error bar but it dosen't work always. For example: Similar commands on two different data sets gives first result OK and second result NOT (attached plot1 is OK and plot2 is NOT). Plots as well as data file is attached here. Below is the script which I

<    1   2