Re: [R] Importing an Excel spreadsheet

2008-03-21 Thread Petr PIKAL
[EMAIL PROTECTED] napsal dne 20.03.2008 23:44:05: Bryan K Woods wrote: If you open the spreadsheet in Excel you can then do Save as... and select type CSV (comma-delimited text). Once you have the data in CSV format, you can use the R function read.csv to import the data. Cheers,

[R] GAMs

2008-03-21 Thread Van Wyk, Jaap
Hi I have been searching for goodness-of-fit tests (or lack of fit tests) for GAMs and cannot find anything. My problem is: after fitting a GAM to mortality data (smoothing crude estimated rates of mortality - a process called graduation in the actuarial literature), (1) how to assess the fit

[R] GAMs

2008-03-21 Thread Van Wyk, Jaap
Hi I have been searching for goodness-of-fit tests (or lack of fit tests) for GAMs and cannot find anything. My problem is: after fitting a GAM to mortality data (smoothing crude estimated rates of mortality - a process called graduation in the actuarial literature), (1) how to assess the fit

Re: [R] two cols in a data frame are the same factor

2008-03-21 Thread Andres Legarra
Looks like it works, albeit the first level is automatically dropped out by lm(). I'll manege to do something with that. The second option looks good too. Thanks Andres On Thu, Mar 20, 2008 at 6:21 PM, Greg Snow [EMAIL PROTECTED] wrote: Here is one approach: First run a regular lm command

Re: [R] SPSS import problem

2008-03-21 Thread K. Elo
Hi, the problem were a couple of overlength labels, indeed. After having removed them, I was able to import the data without any problems. Thanks anyway for Your help. Happy Easter, Kimmo __ R-help@r-project.org mailing list

[R] R.app incompatable with Emacs

2008-03-21 Thread Fredrik Lundgren
Dear R-users on the Mac, With Leopard 10.5.2, R.app GUI 1.23, and Emacs 22.1.1 (i386-apple- darwin9, Carbon Version 1.6.0) I've got the following problem. When editing foo.R in R.app I get myriads of ^M (end-of-line or CR?) in the file when opened with Emacs. This isn't trivial to me as I

[R] hist function+label second y-axis

2008-03-21 Thread canadiangirl19
Dear Forum, hist(x$LAN_3,col=green,xaxt='n',yaxt='n',xlab=,ylab=,main=,type=l) I´d like to craete a line not a bar in the hist function, but regrettably I get only warning messages: 1: Grafikparameter type ist veraltet in: title(main, sub, xlab, ylab, line, outer, ...) 2: Grafikparameter type

Re: [R] hist function+label second y-axis

2008-03-21 Thread Jim Lemon
canadiangirl19 wrote: Dear Forum, hist(x$LAN_3,col=green,xaxt='n',yaxt='n',xlab=,ylab=,main=,type=l) I´d like to craete a line not a bar in the hist function, but regrettably I get only warning messages: 1: Grafikparameter type ist veraltet in: title(main, sub, xlab, ylab, line, outer,

Re: [R] Importing an Excel spreadsheet

2008-03-21 Thread Hans-Peter
I am trying to import an *.xls spreadsheet into R. I am doing this as [snip] Very steep learning curve ... so appreciate your help. By looking at http://www.R-project.org/posting-guide.html - http://cran.r-project.org/doc/manuals/R-data.pdf - Chapter 8 Reading Excel spreadsheets - you can

Re: [R] hist function+label second y-axis

2008-03-21 Thread canadiangirl19
with the plot function I get the timeseries, I want a histogram but as a line and no bars. plot(x$LAN_3,type=h) I solved the second problem with: mtext(Differenzwerte,side=3,line=3) mtext(Häufigkeit (diff Werte),side=4) but get a new little problem: If I set line=3 at the axis=4 R did not show

Re: [R] Importing an Excel spreadsheet [SOLVED]

2008-03-21 Thread andy
Hans-Peter wrote: I am trying to import an *.xls spreadsheet into R. I am doing this as [snip] Very steep learning curve ... so appreciate your help. By looking at http://www.R-project.org/posting-guide.html - http://cran.r-project.org/doc/manuals/R-data.pdf - Chapter 8 Reading

Re: [R] Problem with diff(strptime(...

2008-03-21 Thread Jim Lemon
I think I have worked out the problem, and because it may trouble others, I take the liberty of explaining it on the mailing list. When diff is applied to a vector of POSIXt values returned by strptime, the units depend upon the smallest interval in the input vector. If that interval is less

Re: [R] R.app incompatable with Emacs

2008-03-21 Thread Richard M. Heiberger
Emacs normally recognizes line endings and opens the file correctly. Therefore the first place to look is in the file itself. When some of the lines have ^M and others do not, then emacs assumes you have LF-only line endings and displays the ^M character. The preventive action is to correct the

Re: [R] R.app incompatable with Emacs

2008-03-21 Thread knussear
You can use TextWrangler to quickly change the eol characters used. Ken Fredrik Lundgren-2 wrote: Dear R-users on the Mac, With Leopard 10.5.2, R.app GUI 1.23, and Emacs 22.1.1 (i386-apple- darwin9, Carbon Version 1.6.0) I've got the following problem. When editing foo.R in R.app I

[R] hist densities

2008-03-21 Thread Luke Spadavecchia
Hi there, I was wondering why x-rnorm(n=5000,mean=1.5,sd=0.25) h-hist(x) sum(h$density) [1] 10 I thought the integral of the histogram should be one? These seems strange to me, or am I being silly... Regards Luke Spadavecchia PS. I'm using R 2.5.1 on Mac OSX

[R] Installing R-2.6.2 on Windows multiuser

2008-03-21 Thread Rick Voland
What is the proper way to install/configure R-2.6.2 for M$-Windows XPSP2 for multiple users when the other users don't have administrative rights. I don't remember this was a problem with previous versions of R. I installed R-2.6.2 as administrator on the computer. It installs, runs, and can

Re: [R] ggplot - axis labels angle

2008-03-21 Thread hadley wickham
Hi Bernd, Something like: qplot(mpg, wt, data=mtcars) grid.gedit(xaxis::label::text, rot=45) should do the trick. The only problem is that the automatic sizing is set up to work with one orientation of labels. You might be able to fudge a solution by experimenting with hjust and vjust, and

Re: [R] hist densities

2008-03-21 Thread Prof Brian Ripley
On Fri, 21 Mar 2008, Luke Spadavecchia wrote: Hi there, I was wondering why x-rnorm(n=5000,mean=1.5,sd=0.25) h-hist(x) sum(h$density) [1] 10 I thought the integral of the histogram should be one? These seems strange to me, or am I being silly... The integral is not a sum of heights

[R] rounding in calculation

2008-03-21 Thread John Lande
dear all, I report a problem very simple, that I does non know how to handle. look at the following code: a = rep(16.256, 5) sum(a[1:5]^2) - (sum(a[1:5])^2/5) [1] 2.273737e-13 as you can see i retrieve a non 0 value, when i am expected to. what can I do? sessionInfo() R version 2.6.2

Re: [R] rounding in calculation

2008-03-21 Thread Gabor Csardi
Read R FAQ 7.31 ? http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Gabor On Fri, Mar 21, 2008 at 04:17:28PM +0100, John Lande wrote: dear all, I report a problem very simple, that I does non know how to handle. look at the following code:

[R] Memory Problem

2008-03-21 Thread Georgios Marentakis
Dear all, I am having a memory problem when analyzing a rather large data set with nested factors in R. The model is of the form X~A*B*(C/D/F) A,B,C,D,F being the independent variables some of which are nested. The problem occurs when using aov but also when using glm or lme. In particular I get

[R] warning message in a glm model

2008-03-21 Thread Alfonso Pérez
Hello, my name is Alfonso. I want to apply a logistic model to my data. The variables are, fish length and age length as a continous variable, and cohort as a factor. I consider the interaction between age and cohort in the model. The dependent variable is the probability of being mature. Then

Re: [R] Memory Problem

2008-03-21 Thread Prof Brian Ripley
On Fri, 21 Mar 2008, Georgios Marentakis wrote: Dear all, I am having a memory problem when analyzing a rather large data set with nested factors in R. The model is of the form X~A*B*(C/D/F) A,B,C,D,F being the independent variables some of which are nested. The problem occurs when using

[R] function for the average or expected range?

2008-03-21 Thread Spencer Graves
Hi, All: Is there a function in R to compute the expected range of a sample of size n from some distribution? I ask, because I was recently asked about the control chart constant 'd2', which is the expected range for a sample of size n from a standard normal. There is a fairly

[R] tseries(arma) vs. stats(arima)

2008-03-21 Thread Richard Saba
Hello, The arma function in the tseries package allows estimation of models with specific ar and ma lags with its lag argument. For example: y[t] = a[0] + a[1]y[t-3] +b[1]e[t-2] + e[t] can be estimated with the following specification : arma(y, lag=list(ar=3,ma=2)). Is this possible with

Re: [R] tseries(arma) vs. stats(arima)

2008-03-21 Thread Prof Brian Ripley
arima() certainly does. You missed the 'fixed' argument that allows ARMA coefficients to be set to any value, including 0. Note that arma() does not do ML estimation. For that you have to worry about invertibility, and it can be much harder to do the optimization with constrained parameters.

Re: [R] warning message in a glm model

2008-03-21 Thread Ted Harding
On 21-Mar-08 15:59:05, Alfonso Pérez wrote: Hello, my name is Alfonso. I want to apply a logistic model to my data. The variables are, fish length and age length as a continous variable, and cohort as a factor. I consider the interaction between age and cohort in the model. The dependent

Re: [R] setMethod for [

2008-03-21 Thread Martin Morgan
Hi Musa -- Musa Parmaksiz wrote: Hi Martin, Thanks for the suggestions. If possible I would avoid defining several methods with different signatures. For the first solution,namely setMethod([, signature=signature(x=myClass), function(x, i, j, ..., drop=FALSE)

[R] function for the average or expected range?; CORECTION

2008-03-21 Thread Spencer Graves
Hi, All: ** My previous email on this subject seemed to contain an error; check the correction: Is there a function in R to compute the expected range of a sample of size n from some distribution? I ask, because I was recently asked about the control chart constant 'd2', which is the

Re: [R] R.app incompatable with Emacs

2008-03-21 Thread Fredrik Lundgren
Thanks a lot , Both suggestions by Heiberger and knussear fixed the problem with ^M! However I would also need a method to tweak the default size of the editor window in R.app . After all, there must be a way... 21 mar 2008 kl. 13.50 skrev Richard M. Heiberger: Emacs normally recognizes

Re: [R] S4 : package creation

2008-03-21 Thread Martin Morgan
Hi Christophe -- In terms of documentation, see ?promptClass, ?promptMethods. I don't think the description of package creation in 'S4 Classes in 15 pages, more or less' is the way things are generally done these days. A package might normally look like DESCRIPTION NAMESPACE R/AllClasses.R

[R] lattice: emulating the par(xaxs=i) behaviour

2008-03-21 Thread Thomas Zumbrunn
I tried to emulate the axis interval calculation behaviour of the traditional graphics system (with par(xaxs=i)) in lattice but couldn't find a flexible solution. Let's say a have a simple xyplot: x - seq(0, 1, 0.01) xyplot(x^2 ~ x, type=l) I want to restrict the plotting region to the data

[R] function for the average or expected range?; CORECTION TO CORRECTION

2008-03-21 Thread Spencer Graves
Hi, All: ** My previous email on this subject seemed to contain an error; check the correction below; please excuse my errors. Is there a function in R to compute the expected range of a sample of size n from some distribution? I ask, because I was recently asked about the control chart

[R] what is mvrCv PRESS?

2008-03-21 Thread Markus Mühlbacher
Hello! I have a problem with the multivariante regression function mvr (PLS package) with leave-one-out validation. In the value ...$validation there are the $PRESSs listed. I found in the literature PRESS is the sum of squares of observed minus predicted. Well, I don't

[R] Special Notification.

2008-03-21 Thread PRIZE AWARD NOTIFICATION
Special Notification. Dear Internet User, We are happy to inform you that your email address have emerged winner of (EUR 750,000) in Europe Lottery Award. The online cyber draws was conducted from an exclusive list of 500,000 email addresses of individuals and corporate

Re: [R] Installing R-2.6.2 on Windows multiuser

2008-03-21 Thread Rick Voland
The issue is new to R-2.6.2. I solved my problem for now by replacing with R-2.6.1. The icon to R-2.6.2 for **all users** starts in c:\Documents and Settings\Y\My Documents where Y is the login name of the person who installed. I tried changing this startup directory to C:\Program

[R] sample codes for writting a function with unknown number of arguments

2008-03-21 Thread tomkur2006-takehome
Hi, I need to scan some files, and then do a boxplot graph of them. I also save the output from the boxplot function, so I can process the data later. For example, I need to scan 2 (it can be x, 0x) files here. A-scan(F1)/100; B-scan(F2)/100; Now let's try graph it. N1 is the label for F1,

[R] R/Rmetrics Workshop, Meielisalp 2008, June 29 - July 3

2008-03-21 Thread Diethelm Wuertz
** R/RMETRICS MEIELISALP WORKSHOP 2008 ** Computational Finance and Financial Engineering R/Rmetrics User and Developer Workshop 2008 Lake Thune, Switzerland, June 29th to July 3rd www.rmetrics.org The great interest in the R/Rmetrics software environment and the success of

Re: [R] problem with optim and integrate

2008-03-21 Thread Uwe Ligges
kathie wrote: Dear all, I want to min integrate( (p1*dnorm+p2*dnorm+p3*dnorm)^(1.3)) for p, mu, and sigma. So, I have to estimate 8 parameters(p3=1-p1-p2). I got this warning-Error in integrate(numint, lower = -Inf, upper = Inf) : non-finite function value. My questions are How

Re: [R] setMethod for [

2008-03-21 Thread Musa Parmaksiz
Hi, I modified the method as following setMethod([, signature=signature(x=myClass), function(x, i, j, drop=FALSE) { myCall - sys.call(-1) narg - length(myCall)-length(match.call(call=sys.call(-1))) if (missing(i) missing(j)) {

[R] (no subject)

2008-03-21 Thread cammie12
Hi, I am fairly new to R, and am stuck. I want to write an R function with argument n that returns a vector of length n with n simulated observations from the double exponential distribution with density: ??g(y) = 1/2e^-y ? For the double exponential, I want to generate y~Exp(1) and then

Re: [R] function for the average or expected range?; CORECTION

2008-03-21 Thread Greg Snow
The ptukey and qtukey functions may be what you want (or at least in the right direction). You could also easily estimate this by simulation. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original

[R] writintg wrappers around save()

2008-03-21 Thread Vadim Organovich
Dear R-users, I am trying to write a wrapper function around save() that will report the file which is being saved to. So I thought that the followintg would do the trick, but it doesn't. I understand that 'y' is somehow not visible inside save.verbose, but don't know how to fix this.

Re: [R] writintg wrappers around save()

2008-03-21 Thread Gabor Grothendieck
Try this: save.verbose - function(..., file) { cat(save.verbose:, file, \n) eval.parent(substitute(save(..., file=file))) } On Fri, Mar 21, 2008 at 3:56 PM, Vadim Organovich [EMAIL PROTECTED] wrote: Dear R-users, I am trying to write a wrapper function around save() that will report the

[R] coredump at the end of 'configure' and error for 'make'

2008-03-21 Thread Henry Yu
Hi, I got some errors when I attempted to build R (R-2.6.2) on my Solaris 9 box. Can someone please provide some suggestion on what to do next? The configure process was fine expect that I got some warning and a coredump at the end. What does that affect? Can I still build it? ./configure

Re: [R] Need vector of random double exponentials

2008-03-21 Thread David Winsemius
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Hi, I am fairly new to R, and am stuck. Please use an informative subject line when posting. (And read the Posting Guide. http://www.R-project.org/posting-guide.html I want to write an R function with argument n that returns a vector of

Re: [R] sample codes for writting a function with unknown number of arguments

2008-03-21 Thread Duncan Mackay
At 04:28 22/03/2008, you wrote: Hi, I need to scan some files, and then do a boxplot graph of them. I also save the output from the boxplot function, so I can process the data later. For example, I need to scan 2 (it can be x, 0x) files here. A-scan(F1)/100; B-scan(F2)/100; Now let's try

Re: [R] Importing an Excel spreadsheet [SOLVED]

2008-03-21 Thread Gregory. R. Warnes
The gdata package provides a read.xls() function that will read in an Excel file that will work on any system with Perl installed. -G On Mar 21, 2008, at 6:47AM , andy wrote: Hans-Peter wrote: I am trying to import an *.xls spreadsheet into R. I am doing this as [snip] Very steep

Re: [R] writintg wrappers around save()

2008-03-21 Thread Prof Brian Ripley
From the help page The names of the objects specified either as symbols (or character strings) in '...' or as a character vector in 'list' are used to look up the objects from environment 'envir'. The default for envir is parent.frame(). You want to change it (and watch out

[R] Aggregate with functions using multiple arguments

2008-03-21 Thread Matt Pocernich
Hello, I would like to use aggregate with a function that requires several argument that are columns of data. As a simple example, suppose I have data in the following dataframe and I would like to summarize the difference between columns obs and frc for each site. How would I do this?

[R] difference between 2 ecdfs

2008-03-21 Thread Erwann.Rogard
hi, a) i have something like: ecdfgrp1-ecdf(subset(mydata,TMT_GRP==1)$Y); ecdfgrp2-ecdf(subset(mydata,TMT_GRP==2)$Y); how can i plot the difference between these 2 step functions? i could begin with ecdfrefl-function(x){ecdfgrp2(x)-ecdfgrp1(x);} ... what next? b) if i have a vector with

Re: [R] function for the average or expected range?; CORECTION

2008-03-21 Thread Spencer Graves
Hi, Greg: Thanks very much for the reply. 1. The 'ptukey' and 'qtukey' function are the distribution of the studentized range, not the range. I tried sum(ptukey(x, 2, df=Inf, lower=FALSE))*.1 and got 1.179 vs. 1.128 in the standard table of d2 for n = 2 observations per

[R] How to Package Extra Results to summary.lm

2008-03-21 Thread Matthew Dubins
Dear R users, I came up with some simple functions to give me the standard betas and tolerance values from a predefined lm() model. I have been trying to insert the results from these functions into the coefficients matrix in a modified summary.lm function that I'm calling summary2 (I'd never

Re: [R] Multiple plots question

2008-03-21 Thread Mark Wardle
1. Work out what you want on the x and y scales from your data. 2. In your first call (to plot) set the xlim and ylim parameters to the required range. Good luck, Mark On 20/03/2008, Andre Nathan [EMAIL PROTECTED] wrote: Hello (Sorry if this appears twice, had some mail problems...) I

Re: [R] invalid \uxxxx sequence while trying to create a package

2008-03-21 Thread Charles Annis, P.E.
I'm running R2.6.2 on a DELL box with 2gig RAM, using Rtools (v26). I have a perplexing problem trying to build a package. I've created a small demonstration: problem.demo - function () {cat(\n *** \u00e2 vs a***\n)} This function runs in an R gui session and Rtools makes a

Re: [R] invalid \uxxxx sequence while trying to create a package

2008-03-21 Thread Duncan Murdoch
On 21/03/2008 6:01 PM, Charles Annis, P.E. wrote: I'm running R2.6.2 on a DELL box with 2gig RAM, using Rtools (v26). I have a perplexing problem trying to build a package. I've created a small demonstration: problem.demo - function () {cat(\n *** \u00e2 vs a***\n)}

Re: [R] difference between 2 ecdfs

2008-03-21 Thread David Winsemius
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: hi, a) i have something like: ecdfgrp1-ecdf(subset(mydata,TMT_GRP==1)$Y); ecdfgrp2-ecdf(subset(mydata,TMT_GRP==2)$Y); how can i plot the difference between these 2 step functions? i could begin with

[R] how to scientific notation numbers

2008-03-21 Thread HelponR
Hi, Sorry I have to bother you a question. I have a file with each line like this: 6.5500e+004 2.82350001e+000 3.2000e+001 1.1580e+003 2.4400e+002 5.9800e+002 2.2700e+002 3.9031e+001

Re: [R] how to scientific notation numbers

2008-03-21 Thread Gabor Grothendieck
I can't reproduce that on my system. When I try it it works. (In reality you would replace textConnection(Lines) with the name of your file.) Lines - + 6.5500e+004 2.82350001e+000 3.2000e+001 + 1.1580e+003 2.4400e+002