Re: [R] access to 'formula' terms in a user function

2007-07-07 Thread Prof Brian Ripley
On Fri, 6 Jul 2007, Eric Peterson wrote: This is probably buried somewhere in the R help archives, but I've been unable to find it, so perhaps the keywords I use here will help bring the topic to the surface more easily for future users. I want to write my own modeling function (ultimately

Re: [R] Multiple Stripcharts

2007-07-07 Thread Stephen Tucker
I'm not able to make out your data but something like this? df - data.frame(A=rnorm(10),B=rnorm(10),C=runif(10)) stripchart(df,method=jitter) --- Tavpritesh Sethi [EMAIL PROTECTED] wrote: Hi all, I have 205 rows with measurements for three categories of people. I want to generate stripplots

Re: [R] color scale in rgl plots

2007-07-07 Thread Jim Lemon
David Farrelly wrote: Hello, I'm trying to make a 3d plot using rgl in which the size and color of each point corresponds to certain attributes of each data point. The color attribute, let's call it X, is scaled to go from 0 to 1. The rainbow(64,start=0.7,end=0.1) palette is perfect for

Re: [R] color scale in rgl plots

2007-07-07 Thread Stephen Tucker
Hi David, I'm not an expert in 'rgl', but to determine data-dependent color for points I often use cut(). # using a very simple example, x - 1:2; y - 1:2; z - matrix(1:4,ncol=2) # the following image will be a projection of my intended 3-D 'rgl' plot # into 2-D space (if we don't consider color

[R] suggestions

2007-07-07 Thread Tavpritesh Sethi
Sorry all R'ers, the crazy looking data for my query Multiple Stripcharts was an automatic transpose of what I had pasted. The data was 3 rows indicating three variables, 12 columns indicating samples. the samples were categorized as A,B,C,A,B,C,A,B,C,A,B,C, as denoted by the header of the data. I

Re: [R] Recursion in R ...

2007-07-07 Thread Uwe Ligges
Alberto Monteiro wrote: Ted Harding wrote: So I slickly wrote a recursive definition: Nnk-function(n,k){ if(n==1) {return(k)} else { R-0; for(r in (1:k)) R-(R+Nnk(n-1,k-r+1)) # ,depth)) } return(R) } You are aware that this is equivalent to: Nnk1 - function(n, k) {

[R] Changing integer class

2007-07-07 Thread Christophe Genolini
Hi all I define a function with two methods, one for numeric or integer. Sometime, I need the numeric method to be applied on integer. So I try to change the class of the integer but it does not work... Does someone know why ? x-1:3 class(x) [1] integer class(x)- numeric class(x) [1]

Re: [R] Changing integer class

2007-07-07 Thread jim holtman
?mode x - 1:10 str(x) int [1:10] 1 2 3 4 5 6 7 8 9 10 class(x) - 'numeric' str(x) int [1:10] 1 2 3 4 5 6 7 8 9 10 mode(x) - 'numeric' str(x) num [1:10] 1 2 3 4 5 6 7 8 9 10 On 7/7/07, Christophe Genolini [EMAIL PROTECTED] wrote: Hi all I define a function with two methods, one for

Re: [R] Multiple Stripcharts: Better parallel coordinates?

2007-07-07 Thread Antony Unwin
Like Stephen Tucker I am not sure what your data are and what you actually want. In the iPlots package you can draw interactive parallel coordinate plots or parallel boxplots of x by y (where y is a groups variable). Antony __

Re: [R] Recursion in R ...

2007-07-07 Thread Ted Harding
On 07-Jul-07 10:34:03, Uwe Ligges wrote: Alberto Monteiro wrote: Ted Harding wrote: So I slickly wrote a recursive definition: Nnk-function(n,k){ if(n==1) {return(k)} else { R-0; for(r in (1:k)) R-(R+Nnk(n-1,k-r+1)) # ,depth)) } return(R) } You are aware that this is

Re: [R] Recursion in R ...

2007-07-07 Thread Duncan Murdoch
On 07/07/2007 7:15 AM, (Ted Harding) wrote: On 07-Jul-07 10:34:03, Uwe Ligges wrote: Alberto Monteiro wrote: Ted Harding wrote: So I slickly wrote a recursive definition: Nnk-function(n,k){ if(n==1) {return(k)} else { R-0; for(r in (1:k)) R-(R+Nnk(n-1,k-r+1)) # ,depth)) }

[R] Several quick questions

2007-07-07 Thread Sébastien
Dear R users, Here is a couple a quick questions, for which I was unable to not find any answer in the list archives and in the help: 1- Is there any R equivalents of the VB functions Cint, CStr, etc... (for non VB users, these functions transform the category of a specified variable and

Re: [R] Text Mining

2007-07-07 Thread Ista Zahn
You might also be interested in ReadMe by Daniel Hopkins, Gary King, Matthew Knowles, and Steven Melendez . Website at http:// gking.harvard.edu/readme --Ista On Jul 7, 2007, at 6:00 AM, [EMAIL PROTECTED] wrote: Re: Text Mining Also see Ingo Feinerer's tm package and his nice vignette.

Re: [R] maintaining specified factor contrasts when subsetting in lmer

2007-07-07 Thread Afshartous, David
I'm familiar w/ relevel but that doesn't seem to help here (e.g., tried setting the reference level to 3 but the second model w/ the subset argument doesn't seem to estimate the desired model). Possibly another contrasts statement needs to be provided prior to the second model, this time w/ a

[R] from character string to function body?

2007-07-07 Thread Atte Tenkanen
Dear R users, I wonder if it is possible to form a function from a character string. Here is an example: x=3 `-`(`+`(`^`(x,3),`^`(x,2)),1) # Here is my function evaluated. [1] 35 V=list(`-`,(,`+`,(,`^`,(,x,,,3,),,,`^`,(,x,,,2,),),,,1,)) # Here I construct the string, it could be vector

Re: [R] from character string to function body?

2007-07-07 Thread Sundar Dorai-Raj
Atte Tenkanen said the following on 7/7/2007 8:41 AM: Dear R users, I wonder if it is possible to form a function from a character string. Here is an example: x=3 `-`(`+`(`^`(x,3),`^`(x,2)),1) # Here is my function evaluated. [1] 35

[R] No convergence using ADAPT

2007-07-07 Thread Philip Turk
I am trying calculate a probability using numerical integration. The first program I ran spit out an answer in a very short time. The program is below: ## START PROGRAM trial - function(input) { pmvnorm(lower = c(0,0), upper = c(2, 2), mean = input, sigma = matrix(c(.1, 0, 0, .1), nrow = 2,

[R] random sampling with some limitive conditions?

2007-07-07 Thread Zhang Jian
I want to gain thousands of random sampling data by randomizing the presence-absence data. Meantime, one important limition is that the row and column sums must be fixed. For example, the data tst is following: site1 site2 site3 site4 site5 site6 site7 site8 1 0 0 0 1 1 0 0 0 1 1 1 0 1 0 1 1 0

[R] calculating p-values of columns in a dataframe

2007-07-07 Thread Thomas Pujol
I have a dataframe (mydf) that contains differences of means. I wish to test whether these differences are significantly different from zero. Below, I calculate the t-statistic for each column. What is a good method to calculate/look-up the p-value for each column?

Re: [R] from character string to function body?

2007-07-07 Thread Atte Tenkanen
Thanks Sundar! I wonder that - when evaluating F1 - the right mathematical formula is now also printed! F1 function (x) x^3 + x^2 - 1 Atte Atte Tenkanen said the following on 7/7/2007 8:41 AM: Dear R users, I wonder if it is possible to form a function from a character string.

Re: [R] random sampling with some limitive conditions?

2007-07-07 Thread Daniel Nordlund
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zhang Jian Sent: Saturday, July 07, 2007 12:31 PM To: r-help Subject: [R] random sampling with some limitive conditions? I want to gain thousands of random sampling data by randomizing the

[R] How to calculate the index the number of species combinations?

2007-07-07 Thread Zhang Jian
I want to analyze the co-occurrence of some species. In some papers, the authors said that the indexthe number of species combinations (COMBO) is a good index. I try to calculate the index by R language. But I can not get the right value. I think that I do not understand the concept of the index

Re: [R] How to calculate the index the number of species combinations?

2007-07-07 Thread Sarah Goslee
It should be the number of unique sites. In this case, the number of unique columns in the data frame. See ?unique. (Interestingly, convention is usually that species are columns and sites are rows.) For your sample data you only see 10 of the 2^17 possible combinations of 17 species (not 2n).

Re: [R] How to calculate the index the number of species combinations?

2007-07-07 Thread Zhang Jian
Sorry, I can not understand your reply very clearly. How to compute the number of unique sites ? Can you give me a simply example or do a simply analyse using one data? Thanks very much. Jian Zhang On 7/7/07, Sarah Goslee [EMAIL PROTECTED] wrote: It

[R] one question about the loop

2007-07-07 Thread Zhang Jian
Hi. I want to get a series data just like this: sp1 sp2 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 I can get one part of the data every time, but I can get the data directly. I try to use the loop, but it can not work. How to get it ? Thanks.

Re: [R] How to calculate the index the number of species combin

2007-07-07 Thread Ted Harding
On 07-Jul-07 22:18:42, Zhang Jian wrote: I want to analyze the co-occurrence of some species. In some papers, the authors said that the indexthe number of species combinations (COMBO) is a good index. I try to calculate the index by R language. But I can not get the right value. I think that

Re: [R] one question about the loop

2007-07-07 Thread jim holtman
Is this what you want? t(combn(5,2)) [,1] [,2] [1,]12 [2,]13 [3,]14 [4,]15 [5,]23 [6,]24 [7,]25 [8,]34 [9,]35 [10,]45 On 7/7/07, Zhang Jian [EMAIL PROTECTED] wrote: Hi. I want to get a series data

Re: [R] Loading problem with XML_1.9

2007-07-07 Thread Luo Weijun
Hello Dr. Lang and all, I posted this message in R-help mail list, but haven’t solved my problem so far. Therefore, could you help me look at it? I have loading problem with XML_1.9 under 64 bit R2.3.1 for Mac OS X, which I got from http://R.research.att.com/. XML_1.9 works fine under 32 bit

[R] Making Gehan-Breslow test for Survival data

2007-07-07 Thread José Ignacio Bustos Melo
Hi all, The survivals functions can be tested by the Log-rank test and others, for example the Gehan-Breslow. The graham breslow work with the alpha values. But I don't know how is the Gehan-Breslow test with R. Somebody know a type function?.. or other suggestions? Any help will be really

[R] change the coeffcients approach on an anova

2007-07-07 Thread vincent guyader
hi everybody I have to do a lot of Anova with R and I would like to have another type of coefficients coding.. I explain. by default if I have 2 temperatures for an experience. 100°C or 130°C and I want to see the temperature effect on the presure I want to estimate the coefficient of each

Re: [R] change the coeffcients approach on an anova

2007-07-07 Thread Gabor Grothendieck
On 7/7/07, vincent guyader [EMAIL PROTECTED] wrote: hi everybody I have to do a lot of Anova with R and I would like to have another type of coefficients coding.. I explain. by default if I have 2 temperatures for an experience. 100°C or 130°C and I want to see the temperature effect on the

Re: [R] How to calculate the index the number of speciescombinations?

2007-07-07 Thread Bill.Venables
Here is a step by step explanation. The way you present the data is as species (rows) by sites (columns) data frame dim(species_x_sites) [1] 17 20 There are in fact only 19 sites as one of the columns of the data frame is the species name: names(species_x_sites) [1] Species Cuba

Re: [R] change the coeffcients approach on an anova

2007-07-07 Thread BaKaLeGuM
I have a solution rinfo2 - (aov(pression~ temp, data=rebe)) model.tables(rinfo2) thanks all (good night if is time for your :P ) 2007/7/8, vincent guyader [EMAIL PROTECTED]: hi everybody I have to do a lot of Anova with R and I would like to have another type of coefficients coding.. I

Re: [R] change the coeffcients approach on an anova

2007-07-07 Thread Ted Harding
On 08-Jul-07 00:36:46, vincent guyader wrote: hi everybody I have to do a lot of Anova with R and I would like to have another type of coefficients coding.. I explain. by default if I have 2 temperatures for an experience. 100°C or 130°C and I want to see the temperature effect on the

Re: [R] No convergence using ADAPT

2007-07-07 Thread Robert A LaBudde
What versions of adapt and R are you using? The current package was built with R-2.5.1. I tried your program with R-2.5.0, and got the answer 0.1501053 in just a few seconds. At 03:20 PM 7/7/2007, Philip wrote: I am trying calculate a probability using numerical integration. The first program

[R] Is there Discriminant Adaptive Nearest Neighbor classification?

2007-07-07 Thread Hao Tang
Hello everyone, Is there anyone who is aware of any R package that has Discriminant Adaptive Nearest Neighbor (DANN) classification by Hastie and Tibshirani? Thanks in advance! Tracy [[alternative HTML version deleted]] __