Re: [R] Lisp-like primitives in R

2007-09-06 Thread Roland Rau
François Pinard wrote: I wonder what happened, for R to hide the underlying Scheme so fully, at least at the level of the surface language (despite there are hints). As far as I understood, the original version of Ihaka/Gentleman was written in Scheme. But even if you look at the source

Re: [R] Can I calculcate the percentage of a gamma function area below a cutoff value?

2007-08-14 Thread Roland Rau
Hi Jake Verschuyl wrote: Hi there, I have some bird flight height data that follows a gamma distribution. The data (x) goes from 0 to 700 meters (n=1055). The calculated parameters calculated from the fitdistr(x) are (shape = 5.1379, rate = 0.017541), and therefore the scale

Re: [R] Help wit matrices

2007-08-10 Thread Roland Rau
I hope you don't mind that I offer also two solutions. No.1 is really bad. No.2 should be on par with the other ones. Best, Roland mydata - matrix(rnorm(10*10), ncol=10) threshold.value - 1.5 mydata2 - matrix(0, nrow=nrow(mydata), ncol=ncol(mydata)) mydata3 - matrix(0, nrow=nrow(mydata),

Re: [R] Seasonality

2007-08-10 Thread Roland Rau
Alberto Monteiro wrote: I have a time series x = f(t), where t is taken for each month. What is the best function to detect if _x_ has a seasonal variation? If there is such seasonal effect, what is the best function to estimate it? From my own experience, I had the impression that there is

Re: [R] array

2007-08-07 Thread Roland Rau
Hi, Tiandao Li wrote: Hello, I have some files generated from microarray experiments. I used scan() to read the files, and assigned each file to a unique name with many rows and columns. Now I want to create a array (ArrayA) with unique names, and I can use ArrayA[1,2][[6]] to refer the

Re: [R] the large dataset problem

2007-07-30 Thread Roland Rau
Eric Doviak wrote: I need to find some way to overcome these constraints and work with large datasets. Does anyone have any suggestions? I might be not the most authoritative person on this subject but I put all my large datasets[1] into an SQLite database and extract/summarize data from it

Re: [R] array writing and their filenames

2007-07-30 Thread Roland Rau
Dong GUO 郭东 wrote: Hi, I want to save a array (say, array[6,7,8]) write a cvs file. How can I do that??? can I write in one file? For array[6,7,8], you don't need a csv(!) file since it is only a scalar. If this is what you want, check ?write.table But what you probably meant is how to

[R] GPL Question and Updated Link

2007-07-02 Thread Roland Rau
Dear all, I saw that the Free Software Foundation (www.fsf.org) released Version 3 of their General Public Licence on Friday. Just out of curiosity, are there any plans to 'upgrade' the licensing terms of R? Maybe one can update the licence() function since the link given there

Re: [R] import data

2007-06-30 Thread Roland Rau
Hi Eric, eric zoukekang wrote: Hello! I wonder if you might help me with informations about how to import data with a 2.4.1 R version without the menu Import data. Best regards. the best information about importing data in R is contained in the manual R Data Import/Export which should be

[R] Programming Contests for R?

2007-06-30 Thread Roland Rau
Dear all, I just saw for the first time the 'Matlab Programming Contest' at http://www.mathworks.com/contest/overview.html Is there something comparable for R? Is someone interested in organizing such a thing? Of course, one can try to solve the Matlab Problems Sets in R, but I think it

Re: [R] survreg error

2007-06-26 Thread Roland Rau
Hi K, Devarajan, Karthik wrote: Does anyone have any suggestions\thoughts Hard to say where the problem(s) originate(s). Why don't you provide commented, minimal, self-contained, reproducible code as is recommended on all messages on this mailing list? This would make it much easier to

Re: [R] percentage in R

2007-06-21 Thread Roland Rau
[EMAIL PROTECTED] wrote: Hi There, How to display a number in the formation of percentage? For example, a=0.25, how to display 25%? if you write 'how to display' I guess you mean in a plot? a - 0.25 plot(0:10, 0:10, type=n) text(x=5, y=5, labels=paste(round(a*100,0), %, sep=)) does this

Re: [R] Multinomial models

2007-06-21 Thread Roland Rau
Hi, since you are very new to R, just a small advice: try to give a minimal reproducible, self-contained example. This helps quite often to spot some mistakes yourself. This is my own experience and has been experienced by others, see, for example: library(fortunes) fortune(Ripleyed) :-)

Re: [R] scatterplots: (equal axes and overlay)

2007-06-14 Thread Roland Rau
Hi Matthias, please see below for some code example. Matthias von Rad wrote: Hi, I am doing lots of scatterplots for my dissertation and to make the comparable, I would like to have equal x- amd - y axis. Can I specify their scale? Another question adresses overlay scatterplots. Having prae

Re: [R] R Book Advice Needed

2007-06-13 Thread Roland Rau
Hi, [EMAIL PROTECTED] wrote: I am new to using R and would appreciate some advice on which books to start with to get up to speed on using R. My Background: 1-C# programmer. 2-Programmed directly using IMSL (Now Visual Numerics). 3- Used in past SPSS and Statistica. I put together a

Re: [R] R Book Advice Needed

2007-06-13 Thread Roland Rau
Hi Neil, [EMAIL PROTECTED] wrote: At this point, want to jump in avoiding all the Mathematical proofs and just apply R and the packages for what I want to do. I'd still recommend Venables/Ripley: Modern Applied Statistics with S (or often abbrev. MASS, which is also name of the package

Re: [R] Mandriva Spring 2007 and R

2007-06-05 Thread Roland Rau
Hi Jonathan, Jonathan Morse wrote: I am new to Linux (not to R) and recently installed Mandriva Spring 2007 on my partitioned hard drive. My next objective is to install R in the Linux environment, unfortunately Mandriva is not one of the Linux distributions available for download...

Re: [R] the biggest integer R can display in complete form but not scientific form

2007-06-05 Thread Roland Rau
李俊杰 wrote: Dear R-lister, One of my friends wanted to produce random number which is 64 bits. He did it with Fortune. I think R can do it also. But I don't know how to display a very big integer in the complete form but not scientific form. And what's the biggest integer R can display in

Re: [R] Time format

2007-06-01 Thread Roland Rau
Hi Patrick, [EMAIL PROTECTED] wrote: Dear R-help list members, I am new to R, and having problems with plotting part of a time series. I have read in my data using read.table, and my 'time' column is recognised as a numeric variable. When I convert this to a time format, I am no longer

Re: [R] cox goodness of fit

2007-05-31 Thread Roland Rau
Hi, assuming you are doing a Cox-PH-Model, you can check: library(survival) ?coxph.object There it says that the components 'residuals' refers to the martingale residuals. I hope I recall it correctly but there exists a simple relation between the martingale residuals ('mgr') and the

Re: [R] plot problems

2007-05-21 Thread Roland Rau
Markus voigt wrote: because it should start at 2. Is there a parameter where you can define the start on the x-axis? Maybe this will help you? datax1 - 1:8 datax2 - 2:9 datay1 - runif(length(datax1)) datay2 - runif(length(datax2)) plot(x=datax1, y=datay1, type=l, col=blue, xlab=X,

Re: [R] size limit in R?

2007-05-21 Thread Roland Rau
[EMAIL PROTECTED] wrote: Hi, Please see the email exchanges below. I am having trouble generating output that is large enough for our needs, specifically when using the GaussRF function. However, when I wrote Dr. Schlather (the author of the GaussRF function), he indicated that there

[R] read.table opening a website incl Password

2007-05-16 Thread Roland Rau
Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password (a different site)? How do I do

Re: [R] read.table opening a website incl Password

2007-05-16 Thread Roland Rau
the '@'-character has some ambiguous meaning in my setting. Sorry that I did not think of that beforehand. Thank you very much for your help, Roland Prof Brian Ripley wrote: On Wed, 16 May 2007, Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example

Re: [R] plot time series

2007-05-08 Thread Roland Rau
Hi Jessica [EMAIL PROTECTED] wrote: __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] censoring

2007-05-08 Thread Roland Rau
Well, I guess it makes quite a difference in survival analysis whether you know that a person was alive/censored or experienced the event of interest at a certain point of time/age. You could have tried it easily for yourself by slightly modifying the example on the help page of 'survdiff'.

Re: [R] Looking for a comprehensive descriptive statistics package

2007-05-08 Thread Roland Rau
Hi, summary(yourdata) is often a very good starting point for descriptive data statistics. Or you can write your own little function which returns what you actually like to see (the code below was written very quickly. No care is taken for the presence of missing values or anything else).

Re: [R] Representing a statistic as a colour on a 2d plot

2007-05-08 Thread Roland Rau
mister_bluesman wrote: Thanks people! Sorry to sound thick but after I download the poltrix package, how do i install it? Thank you! which platform are you on? On Windows I would suggest you use the Menu of the GUI Install packages from local zip files in the main category 'packages' On

Re: [R] Read every second line from ASCII file

2007-05-02 Thread Roland Rau
! Roland Roland Rau wrote: Dear all, I have an ASCII file where records are separated by a blank. I would like to read those data; however, only the data in rows 1, 3, 5, 7, ... are important; the other lines (2,4,6,8,) contain no useful information for me. So far I used awk/gawk

Re: [R] logrank test

2007-05-01 Thread Roland Rau
Hi, On 5/1/07, raymond chiruka [EMAIL PROTECTED] wrote: how do l programme the logrank test. l am trying to compare 2 survival curves if you simply want to use the logrank test, have a look at the first example of the function survdiff in the survival package. If you read the help page

Re: [R] logrank test

2007-05-01 Thread Roland Rau
And since Peter Dalgaard also just answered (without advertising his book): if you (or your library) happen to have 'Introductory Statistics with R' by Peter Dalgaard, have a look at section 12.4. Best, Roland On 5/1/07, raymond chiruka [EMAIL PROTECTED] wrote: how do l programme the logrank

[R] Read every second line from ASCII file

2007-04-30 Thread Roland Rau
Dear all, I have an ASCII file where records are separated by a blank. I would like to read those data; however, only the data in rows 1, 3, 5, 7, ... are important; the other lines (2,4,6,8,) contain no useful information for me. So far I used awk/gawk to do it: gawk '{if ((FNR % 2) != 0)

Re: [R] installing R on Ubuntu

2007-04-17 Thread Roland Rau
I am not sure what the question is but maybe this provides a starting point? http://cran.r-project.org/bin/linux/ubuntu/README HTH, Roland On 4/16/07, Erin Hodgess [EMAIL PROTECTED] wrote: __ R-help@stat.math.ethz.ch mailing list

Re: [R] Greatest common divisor of two numbers

2007-04-17 Thread Roland Rau
Hi, wouldn't it be enough for simple purposes (as stated in the original message: Greatest common divisor of two numbers) to use: gcd - function(a,b) ifelse (b==0, a, gcd(b, a %% b)) gcd(12,4) [1] 4 gcd(4,12) [1] 4 gcd(123456789,987654321) [1] 9 gcd(987654321,123456789) [1] 9 Best, Roland

Re: [R] Is this a bug?

2007-04-17 Thread Roland Rau
On 4/17/07, Luca Braglia [EMAIL PROTECTED] wrote: I have found a strange ifelse behaviour (I think) Don't you think it is rather consistent behavior? ifelse(T,1+1,1+2) [1] 2 ifelse(F,1+1,1+2) [1] 3 ifelse(T,hello,goodbye) [1] hello ifelse(F,hello,goodbye) [1] goodbye

[R] R Python Matlab

2007-04-09 Thread Roland Rau
Dear all, on programming.reddit.com, I found a link to a PDF document which compares on 17 pages commands/functions in Matlab, Python and R. http://37mm.no/download/matlab-python-xref.pdf I hope I am not re-posting which has been posted recently. Best, Roland [[alternative HTML

Re: [R] Reasons to Use R

2007-04-06 Thread Roland Rau
Hi Lorenzo, On 4/5/07, Lorenzo Isella [EMAIL PROTECTED] wrote: I would like to have suggestions about where to collect info about: (1)Institutions (not only academia) using R A starting point might be to look at the R-project homepage and look at the members and donors list. This is, of

Re: [R] Fwd: Package-RODBC-MSACCESS

2007-03-07 Thread Roland Rau
Hi, On 3/7/07, j.joshua thomas [EMAIL PROTECTED] wrote: I have used RODBC to get the database i can view the tables in RGUI-2.4.1 how can i query the records in R i tried with sqlQuery need some help A bit of code showing what you did would help others to track down what may have gone

Re: [R] Examples on how to READ/WRITE to database using R-Project

2007-02-21 Thread Roland Rau
Hi, On 2/21/07, Venkatesh Mantha [EMAIL PROTECTED] wrote: We are working on a project on forecast modeling and would like to know if there are any examples on how to READ/WRITE to a database (e.g. PostgreSQL) did you have a look at the Manual R Data Import/Export? I have to admit that I

Re: [R] convert to binary to decimal

2007-02-16 Thread Roland Rau
On 2/16/07, Petr Pikal [EMAIL PROTECTED] wrote: Hi slight modification of your function can be probably even quicker: fff-function(x) sum(2^(which(rev(x))-1)) :-) Petr Yes, your function is slightly but consistently faster than my suggestion. But my tests show still Bert Gunter's

Re: [R] convert to binary to decimal

2007-02-15 Thread Roland Rau
That was a nice quick distraction. Unfortunately, I am not the first to answer. :-( Anyway, I offer two solutions (which are different from the one of Marc Schwartz); I wrote it quickly but I hope they are correct. Enjoy and thanks, Roland a - c(TRUE, FALSE, TRUE) b - c(TRUE, FALSE, TRUE, TRUE)

Re: [R] convert to binary to decimal

2007-02-15 Thread Roland Rau
Statistics South San Francisco, CA 94404 650-467-7374 Bert Gunter Nonclinical Statistics 7-7374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roland Rau Sent: Thursday, February 15, 2007 8:22 AM To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch

[R] two perspective plots in in plot

2007-02-09 Thread Roland Rau
Dear all, I would like to put two perspective plots into one plot. The help page for ?persp shows how one can add points and lines but not another perspective plot. data(volcano) z - 2 * volcano# Exaggerate the relief x - 10 * (1:nrow(z)) # 10 meter spacing (S to N) y - 10 *

Re: [R] two perspective plots in in plot

2007-02-09 Thread Roland Rau
Thanks Duncan and Greg. My current solution is to use the rgl-package. Is there an easy way to obtain a screenshot in eps- or pdf-Format from such an rgl-window? I saw the rgl.snapshot function but it does not provide this format. So far, I take a snapshot, save it as jpeg and convert it to eps

Re: [R] R in Industry

2007-02-08 Thread Roland Rau
Hi, On 2/8/07, Albrecht, Dr. Stefan (AZ Private Equity Partner) [EMAIL PROTECTED] wrote: I would very much appreciate any comments on my above remarks. I know there has been some discussions of R vs. Matlab on R-help, but these could be somewhat out-dated, since both languages are evolving

Re: [R] Help with interfacing C R

2007-02-08 Thread Roland Rau
Hi, On 2/8/07, Oleg Sklyar [EMAIL PROTECTED] wrote: On Windows you need: - download and install Cygwin (cygwin.com) with default options, supposedly you install into c:\cygwin. Add path to c:\cygwin\bin;c:\cygwin\lib to your system PATH No. You don't need Cygwin. I don't have it

Re: [R] loop issues (r.squared)

2007-02-08 Thread Roland Rau
Hi, On 2/8/07, andy1983 [EMAIL PROTECTED] wrote: That was a neat trick. However, it created a new problem. Before, it took way too long for a 10,000 columns to finish. Now, I test the memory limit. With 10,000 columns, I use up about 1.5 GBs. Assuming memory is not the issue, I still end

Re: [R] Help with interfacing C R

2007-02-08 Thread Roland Rau
tools I mentioned above! Oleg -- Dr Oleg Sklyar | EBI-EMBL, Cambridge CB10 1SD, UK | +44-1223-494466 Roland Rau wrote: Hi, On 2/8/07, *Oleg Sklyar* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: On Windows you need: - download and install Cygwin (cygwin.com http

Re: [R] R syntaxe

2007-02-02 Thread Roland Rau
Hi, On 2/2/07, Martin Olivier [EMAIL PROTECTED] wrote: Hi all, Suppose I have a vector x with numerical values. In y, I have a categorial variable : y-c(1,1,..2,2,...30,30,30) x and y have the same length. I would like to compute the mean for x for the modality 1 to 30 in y.

Re: [R] when i configure the R 2.4.1,i meet the problem

2007-02-01 Thread Roland Rau
On 2/1/07, xiaopeng hu [EMAIL PROTECTED] wrote: i get the message : configure: WARNING: you cannot build info or html versions of the R manuals how to deal with it ? did you read the manual 'R Installation and Administration'? see section 2.2 there. it is mentioned there that you need

[R] Reversal of Aggregation

2007-01-29 Thread Roland Rau
Dear all, given I have a data.frame in a format like this mydf - data.frame(age=rep(1:3,5), year=c(rep(1996,3), rep(1997,3), rep(1998,3), rep(1999,3), rep(2000,3)), income=1:15) mydf Now I convert it to some 2D-frequency table like

Re: [R] Reversal of Aggregation

2007-01-29 Thread Roland Rau
This is what I was hoping for! Thanks, Roland On 1/29/07, Achim Zeileis [EMAIL PROTECTED] wrote: On Mon, 29 Jan 2007, Roland Rau wrote: Dear all, given I have a data.frame in a format like this mydf - data.frame(age=rep(1:3,5), year=c(rep(1996,3), rep(1997,3

Re: [R] Error in basehaz function ?

2007-01-19 Thread Roland Rau
Hi, David Mas wrote: I believe that the way basehaz (in the survival package) compute the baseline hazard function is false. I come to question this function when it gives me hazard probabilities greater than 1. Looking at the code I think I've localised the error : hazard probability