[R] cauculating dissimilarities in R

2006-09-26 Thread virgin
Dear All, I’ve got a statistical question on calculating dissimilarities in R. I want to calculate the different types of dissimilarities on the ‘flower’ dataset found in the package ‘cluster’. Flower is a data frame with 18 observations on 8 variables. Variable 1 and 2 are binary, variable 3 is

Re: [R] Sort problem with merge (again)

2006-09-26 Thread Prof Brian Ripley
On Mon, 25 Sep 2006, Bruce LaZerte wrote: # R version 2.3.1 (2006-06-01) Debian Linux testing # Is the following behaviour a bug, feature or just a lack of # understanding on my part? I see that this was discussed here # last March with no apparent resolution. Reference? It is the third

[R] calculating dissimilarities in R

2006-09-26 Thread virgin
 Dear All, I’ve got a statistical question on calculating dissimilarities in R. I want to calculate the different types of dissimilarities on the ‘flower’ dataset found in the package ‘cluster’. Flower is a data frame with 18 observations on 8 variables. Variable 1 and 2 are binary, variable 3 is

[R] warning message in nlm

2006-09-26 Thread singyee ling
Dear R-users, I am trying to find the MLEs for a loglikelihood function (loglikcs39) and tried using both optim and nlm. fredcs39-function(b1,b2,x){return(exp(b1+b2*x))} loglikcs39-function(theta,len){ sum(mcs39[1:len]*fredcs39(theta[1],theta[2],c(8:(7+len))) - pcs39[1:len] *

[R] lapply, plot and additional arguments

2006-09-26 Thread Petr Pikal
Dear all Hopefully somebody will know the answer. I have some list x - data.frame(a = 1:9, beta = exp(-4:4), logic = rep(c(TRUE,FALSE), c(5,4))) x.l - split(x, x$logic) plot(x.l$a, x.l$beta) and I want to plot lines color coded according to logic variable lapply(x.l, function(x, ...)

[R] [R-pkgs] the IPSUR package

2006-09-26 Thread G. Jay Kerns
Dear useRs, We are pleased to announce the preliminary release of the IPSUR package. The primary audience was originally envisioned to be upper division undergraduate mathematics/statistics/engineering majors, but other useRs may find this material useful. In a nutshell, this package slightly

[R] Different results in agnes and hclust

2006-09-26 Thread rrein
Hello to everybody, I have a question regarding the results obtained from the hclust and the agnes funtion using the ward algorithm because they seem to differ from each other. I also ran a cluster analysis using the ward algorithm in Matlab and obtained the same results as from agnes. I'm using

[R] rpart

2006-09-26 Thread henrigel
Dear r-help-list: If I use the rpart method like cfit-rpart(y~.,data=data,...), what kind of tree is stored in cfit? Is it right that this tree is not pruned at all, that it is the full tree? If so, it's up to me to choose a subtree by using the printcp method. In the technical report from

[R] About the display of matrix

2006-09-26 Thread S.Q. WEN
For a matrix A, i don't want to display the zero elements in it , How to do with that? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Voung test implementation in R

2006-09-26 Thread mirko sanpietrucci
Dear All, I would like to know if the Voung test (Voung; Econometrica, 1989) to compare two non-nested regression models has been implemented in R. Thanks in advance for your assistance, mirko [[alternative HTML version deleted]] __

Re: [R] Creating Movies with R

2006-09-26 Thread Romain Francois
J.R. Lockwood wrote: An alternative that I've used a few times is the jpg() function to create the sequence of images, and then converting these to an mpeg movie using mencoder distributed with mplayer. This works on both windows and linux. I have a pretty self-contained example file

[R] package usage statistics.

2006-09-26 Thread Vladimir Eremeev
Dear useRs, Is it possible to get the R package usage statistics? That is, does R contain any tools to estimate which packages were used and how often? I am going to temporary change the workplace and packing the data and their processing scripts on my computer in order to continue my

Re: [R] venn diagram with more than three vectors

2006-09-26 Thread Gavin Simpson
On Tue, 2006-09-26 at 10:02 +0200, Oosting, J. (PATH) wrote: I am not aware of existing functions to draw venn diagrams with more than 3 sets, but you could have a look at http://en.wikipedia.org/wiki/Venn_diagram to see how these can be constructed. Jan Oosting Package vegan has a

Re: [R] rpart

2006-09-26 Thread Prof Brian Ripley
On Mon, 25 Sep 2006, [EMAIL PROTECTED] wrote: Dear r-help-list: If I use the rpart method like cfit-rpart(y~.,data=data,...), what kind of tree is stored in cfit? Is it right that this tree is not pruned at all, that it is the full tree? It is an rpart object. This contains both the

[R] Accessing C- source code of R

2006-09-26 Thread Gunther Höning
Dear list, I'm looking for the sources code of parts of R, (e.g. spline). Does anyone know where I can access it ? Gunther __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] venn diagram with more than three vectors

2006-09-26 Thread Oosting, J. \(PATH\)
I am not aware of existing functions to draw venn diagrams with more than 3 sets, but you could have a look at http://en.wikipedia.org/wiki/Venn_diagram to see how these can be constructed. Jan Oosting -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pan

Re: [R] glmmPQL in 2.3.1

2006-09-26 Thread Prof Brian Ripley
On Mon, 25 Sep 2006, Justin Rhodes wrote: Dear R-help, I recently tried implementing glmmPQL in 2.3.1, I thought *I* had implemented it: are you talking about my function in package MASS or your own implementation? and I discovered a few differences as compared to 2.2.1. You appear to be

Re: [R] printing a variable name in a for loop

2006-09-26 Thread David Barron
This would do it: v1 - 5 v2 - 6 v3 - 7 vns - paste(v,1:3,sep=) for (i in 1:length(vns)) cat(Hello, vns[i], get(vns[i]), World\n, sep=,) Hello,v1,5,World Hello,v2,6,World Hello,v3,7,World On 24/09/06, Suzi Fei [EMAIL PROTECTED] wrote: Hello, How do you print a variable name in a for

[R] Statistical data and Map-package

2006-09-26 Thread Rense Nieuwenhuis
Dear helpeRs, I'm working with the map-package and came upon a problem which I couldn't solve. I hope onee of you can. If not, this can be seen as a suggestion for new versions of the package. I'm trying to create a map of some European countries, filled with colors corresponding to some

Re: [R] printing a variable name in a for loop

2006-09-26 Thread Jim Lemon
Suzi Fei wrote: Hello, How do you print a variable name in a for loop? I'm trying to construct a csv file that looks like this: Hello, variable1, value_of_variable1, World, Hello, variable2, value_of_variable2, World, Hello, variable3, value_of_variable3, World,

Re: [R] Statistical data and Map-package

2006-09-26 Thread Roger Bivand
On Tue, 26 Sep 2006, Rense Nieuwenhuis wrote: Dear helpeRs, I'm working with the map-package and came upon a problem which I couldn't solve. I hope onee of you can. If not, this can be seen as a suggestion for new versions of the package. I'm trying to create a map of some European

Re: [R] Need help with boxplots

2006-09-26 Thread Gabor Grothendieck
To prevent confusion you might want to use a red dot rather than a line: points(1:2, c(mean(a), mean(b)), col = red) and perhaps label it since its non-standard: text(1:2, c(mean(a), mean(b)), Mean, pos = 4) On 9/26/06, laba diena [EMAIL PROTECTED] wrote: How to add a mean line in the

[R] Need help with boxplots

2006-09-26 Thread laba diena
How to add a mean line in the boxplot keeping the median line ? For example in this: set.seed(1) a - rnorm(10) b - rnorm(10) boxplot(a, b) [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

[R] Vectorise a for loop?

2006-09-26 Thread john seers \(IFR\)
Hi R guru coders I wrote a bit of code to add a new column onto a topTable dataframe. That is a list of genes processed using the limma package. I used a for loop but I kept feeling there was a better way using a more vector oriented approach. I looked at several commands such as apply, by etc

Re: [R] package usage statistics. (UPDATE)

2006-09-26 Thread Vladimir Eremeev
Here is the perl script with some comments pre #!/bin/perl -w use File::Find; # we use the standard Perl module. # its procedure will scan the directory tree and put all package names to the hash # along with counting the number of their loadings. %pkgs=(base=-1,#

Re: [R] Voung test implementation in R

2006-09-26 Thread ronggui
Yes, the pscl package contains that function. library(pscl) ?vuong Description Compares two models fit to the same data that do not nest via Vuong's non-nested test. Usage vuong(m1, m2, digits = getOption(digits)) On 9/26/06, mirko sanpietrucci [EMAIL PROTECTED] wrote: Dear All, I would

Re: [R] putting stuff into bins...

2006-09-26 Thread Peter Dalgaard
Federico Calboli [EMAIL PROTECTED] writes: Hi All, I have a vector of data, a vector of bin breakpoints and I want to put my data in the bins and then extract fanciful informations like the mean value of each bin. I know I can write my own function, but I would have thought that R

[R] putting stuff into bins...

2006-09-26 Thread Federico Calboli
Hi All, I have a vector of data, a vector of bin breakpoints and I want to put my data in the bins and then extract fanciful informations like the mean value of each bin. I know I can write my own function, but I would have thought that R should have somewhere a function that took as

Re: [R] putting stuff into bins...

2006-09-26 Thread Dietrich Trenkler
Federico Calboli schrieb: Hi All, I have a vector of data, a vector of bin breakpoints and I want to put my data in the bins and then extract fanciful informations like the mean value of each bin. I know I can write my own function, but I would have thought that R should have

Re: [R] rpart

2006-09-26 Thread Prof Brian Ripley
On Tue, 26 Sep 2006, [EMAIL PROTECTED] wrote: Original-Nachricht Datum: Tue, 26 Sep 2006 09:56:53 +0100 (BST) Von: Prof Brian Ripley [EMAIL PROTECTED] An: [EMAIL PROTECTED] Betreff: Re: [R] rpart On Mon, 25 Sep 2006, [EMAIL PROTECTED] wrote: Dear r-help-list: If I

Re: [R] package usage statistics. (UPDATE)

2006-09-26 Thread Roger Bivand
On Tue, 26 Sep 2006, Vladimir Eremeev wrote: Here is the perl script with some comments ?? t1 - installed.packages() t2 - is.na(t1[,Priority]) t3 - names(t2)[t2] t4 - sapply(t3, function(n) file.info(system.file(R, package=n)[1])$atime) class(t4) - POSIXct sort(t4) though the R directory may

Re: [R] putting stuff into bins...

2006-09-26 Thread Stefano Calza
I don't know about such a function, but tapply(data,cut(data,breaks),what to do) should give you what you need. HIH Ciao, Stefano On Tue, Sep 26, 2006 at 12:44:35PM +0100, Federico Calboli wrote: FedericoHi All, Federico FedericoI have a vector of data, a vector of bin breakpoints and I want

[R] about the determinant of a symmetric compound matrix

2006-09-26 Thread Stefano Sofia
Dear R users, even if this question is not related to an issue about R, probably some of you will be able to help me. I have a square matrix of dimension k by k with alpha on the diagonal and beta everywhee else. This symmetric matrix is called symmetric compound matrix and has the form a( I +

Re: [R] rpart

2006-09-26 Thread henrigel
Original-Nachricht Datum: Tue, 26 Sep 2006 09:56:53 +0100 (BST) Von: Prof Brian Ripley [EMAIL PROTECTED] An: [EMAIL PROTECTED] Betreff: Re: [R] rpart On Mon, 25 Sep 2006, [EMAIL PROTECTED] wrote: Dear r-help-list: If I use the rpart method like

Re: [R] putting stuff into bins...

2006-09-26 Thread David Barron
This would work. The point is to make a factor from the breakpoints using cut, then use this to calculate the statistics on the binned data. x - rnorm(500) f - cut(x,10) aggregate(x,list(f),mean) Group.1 x 1(-2.71,-2.09] -2.3668991 2(-2.09,-1.46] -1.7332011 3

[R] crostab qry - Too many crosstab column headers

2006-09-26 Thread Anders Bjørgesæter
Hello I guess not, but is there a way to reduce/split up a MS-access crosstab query resulting in more than 256 cols. by using sqlGetResults in RODBC to e.g. produce several dataframes of 256 columns (that is without changing the query itself). --- [1] [RODBC] ERROR: Could not SQLExecDirect

Re: [R] Vectorise a for loop?

2006-09-26 Thread Jacques VESLOT
tt$fold - ifelse(tt$M 0, 1/(2^tt$M), 2^tt$M) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31 http://www-good.ibl.fr

Re: [R] rpart

2006-09-26 Thread henrigel
Original-Nachricht Datum: Tue, 26 Sep 2006 12:54:22 +0100 (BST) Von: Prof Brian Ripley [EMAIL PROTECTED] An: [EMAIL PROTECTED] Betreff: Re: [R] rpart On Tue, 26 Sep 2006, [EMAIL PROTECTED] wrote: Original-Nachricht Datum: Tue, 26 Sep 2006 09:56:53

[R] Need help with boxplots

2006-09-26 Thread laba diena
How to add a mean *line* in the boxplot keeping the median line ? Maybe it is possible to do using the *segments* function ? For example in this: set.seed(1) a - rnorm(10) b - rnorm(10) boxplot(a, b) [[alternative HTML version deleted]] __

Re: [R] Vectorise a for loop?

2006-09-26 Thread john seers \(IFR\)
Hi Jacques Yes, that looks a whole lot better. That ifelse is exactly what I was searching for. Merci. J --- John Seers Institute of Food Research Norwich Research Park Colney Norwich NR4 7UA tel +44 (0)1603 251497 fax +44 (0)1603 507723 e-mail [EMAIL PROTECTED]

[R] creation of new variables

2006-09-26 Thread nalluri pratap
Hello All, I have 8 variables named a b c d e f g h I need to create four variables from these 8 vraibles in R. the new variables are ab,cd,ef,gh. Can anyone pleas help me thanks, Pratap

Re: [R] about the determinant of a symmetric compound matrix

2006-09-26 Thread Peter Dalgaard
Stefano Sofia [EMAIL PROTECTED] writes: Dear R users, even if this question is not related to an issue about R, probably some of you will be able to help me. I have a square matrix of dimension k by k with alpha on the diagonal and beta everywhee else. This symmetric matrix is called

[R] treatment effect at specific time point within mixed effects model

2006-09-26 Thread Afshartous, David
All, The code below is for a pseudo dataset of repeated measures on patients where there is also a treatment factor called drug. Time is treated as categorical. What code is necessary to test for a treatment effect at a single time point, e.g., time = 3? Does the answer matter if the

Re: [R] package usage statistics. (UPDATE)

2006-09-26 Thread Vladimir Eremeev
Dear Roger, Tuesday, September 26, 2006, 4:16:38 PM, you wrote: RB On Tue, 26 Sep 2006, Vladimir Eremeev wrote: Here is the perl script with some comments RB ?? Sorry, forgot to mention, this script is designed to run from the root of the working directory tree. It scans all R session

[R] October R/Splus course in Washington DC, San Francisco, Seattle *** R/Splus Fundamentals and Programming Techniques

2006-09-26 Thread elvis
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce our 2-day October 2006 R/S-plus Fundamentals and Programming Techniques : www.xlsolutions-corp.com/Rfund.htm *** Washington DC / October 12-13, 2006 *** Seattle Wa / October 19-20 *** San Francisco / October 26-27

Re: [R] printing a variable name in a for loop

2006-09-26 Thread Henrik Bengtsson
Example: lst - list(variable1, variable2, variable3) for (kk in seq(along=lst)) { name - names(lst)[kk]; value - lst[[kk]]; cat(Hello,, name, value, , World,) } /Henrik On 9/26/06, Jim Lemon [EMAIL PROTECTED] wrote: Suzi Fei wrote: Hello, How do you print a variable name in a for

Re: [R] putting stuff into bins...

2006-09-26 Thread Dimitris Rizopoulos
probably a combination of cut() and tapply() could be of help in this case, e.g., x - rnorm(100) tapply(x, cut(x, -4:4), mean) Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven,

Re: [R] Accessing C- source code of R

2006-09-26 Thread Uwe Ligges
Gunther Höning wrote: Dear list, I'm looking for the sources code of parts of R, (e.g. spline). Does anyone know where I can access it ? I plan to write a corresponding R Help Desk article on Accessing the source. A draft is available from:

[R] venn diagram with more than three vectors

2006-09-26 Thread Pan Zheng
Hi, I am using venn diagram function in AMDA to plot the venn diagram. But it seems in this function, it can only plot 3 or less vectors. Is there a way to plot the venn diagram with more than 3 vectors? Please help. Thanks. Z

Re: [R] About the display of matrix

2006-09-26 Thread Martin Maechler
SQW == S Q WEN [EMAIL PROTECTED] on Mon, 25 Sep 2006 23:12:10 -0700 writes: SQW For a matrix A, i don't want to display the zero SQW elements in it , How to do with that? (Using a fairly recent version of R) Either use as.table() and use the print() method for table explicitly, or,

Re: [R] Need help with boxplots

2006-09-26 Thread David Barron
The problem with a line, I think, would be that the width of the boxes can vary depending on the number of boxes in the plot, etc. No doubt it could be done, but you'd probably have to look into the bxp function to see how the widths are calculated. On 26/09/06, laba diena [EMAIL PROTECTED]

Re: [R] calculating dissimilarities in R

2006-09-26 Thread Martin Maechler
Hi Elvina, Elvina == Elvina Payet [EMAIL PROTECTED] on Tue, 26 Sep 2006 05:48:01 GMT writes: Elvina __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Statistical data and Map-package

2006-09-26 Thread Greg Snow
You may also want to look at the maptools (and sp) package, it can read in and plot shapefiles from external sources. Some sources of maps that maptools can plot include: http://www.vdstech.com/map_data.htm http://openmap.bbn.com/data/shape/timezone/

Re: [R] Need help with boxplots

2006-09-26 Thread Gabor Grothendieck
And if you really do want a line segment try this: M - c(mean(a), mean(b)) segments(1:2-0.4, M, 1:2+0.4, M, col = red) On 9/26/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: To prevent confusion you might want to use a red dot rather than a line: points(1:2, c(mean(a), mean(b)), col =

Re: [R] lapply, plot and additional arguments

2006-09-26 Thread Dimitris Rizopoulos
maybe something like this could help: x - data.frame(a = 1:9, beta = exp(-4:4), logic = rep(c(TRUE, FALSE), c(5, 4))) x.l - split(x, x$logic) plot(x$a, x$beta) mapply(function(x, y) lines(x$a, x$b, col = y), x.l, 1:2) Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical

[R] set off error messages

2006-09-26 Thread Mollet, Fabian
Hello there! I'm creacting a loop for(i in 1:n){...}within which I build a nls model at each iteration. for some of the values of i, the algoritm in the nls function doesn't converge or cannot find a solution and consequently an error message is produced, and so my loop is interupted. The

Re: [R] set off error messages

2006-09-26 Thread Thomas Lumley
On Tue, 26 Sep 2006, Mollet, Fabian wrote: Hello there! I'm creacting a loop for(i in 1:n){...}within which I build a nls model at each iteration. for some of the values of i, the algoritm in the nls function doesn't converge or cannot find a solution and consequently an error message is

[R] Extention of Pie Chart in R (was Re: Adding percentage to Pie Charts)

2006-09-26 Thread Anupam Tyagi
Jim Lemon jim at bitwrit.com.au writes: I admit to interpreting this pretty loosely, but I would like to know what people think of a fan plot. Hi all, I tried the fan.plots that Jim has been very nice to provide. It made me think if there was something like, clock.plots in R? Something like

Re: [R] set off error messages

2006-09-26 Thread David Barron
Try ?try On 26/09/06, Mollet, Fabian [EMAIL PROTECTED] wrote: Hello there! I'm creacting a loop for(i in 1:n){...}within which I build a nls model at each iteration. for some of the values of i, the algoritm in the nls function doesn't converge or cannot find a solution and consequently an

Re: [R] Not all functions work in RSPerl package?

2006-09-26 Thread Xianjun Dong
Hi, Prof Duncan I am sorry to report to a wrong place. But I am lucky to meet you by chance, right? Thanks first ^^ 1. The variable y1 is an array get from Perl, each element is from a database (the type should be numeric). Here is the code for that. $query = qq{

[R] read.xport: Writing and reading dataframe to disk directly

2006-09-26 Thread Anupam Tyagi
Hi All, is there a way of directly writing to disk file, the dataframe or list of dataframes that result from read.xport function. This function converts SAS export files to R dataframes. I would like to convert a SAS transport file to R, but the resulting R dataframes do not fit in the memory of

[R] New project: littler for GNU R

2006-09-26 Thread Jeffrey Horner
What ? == littler - Provides hash-bang (#!) capability for R (www.r-project.org) Why ? = GNU R, a language and environment for statistical computing and graphics, provides a wonderful system for 'programming with data' as well as interactive exploratory analysis, often

Re: [R] New project: littler for GNU R

2006-09-26 Thread Gabor Grothendieck
Any plans for Windows? On 9/26/06, Jeffrey Horner [EMAIL PROTECTED] wrote: What ? == littler - Provides hash-bang (#!) capability for R (www.r-project.org) Why ? = GNU R, a language and environment for statistical computing and graphics, provides a wonderful system for

Re: [R] dotplot, dropping unused levels of 'y'

2006-09-26 Thread Benjamin Tyner
Deepayan Sarkar wrote: On 9/15/06, Benjamin Tyner [EMAIL PROTECTED] wrote: In dotplot, what's the best way to suppress the unused levels of 'y' on a per-panel basis? This is useful for the case that 'y' is a factor taking perhaps thousands of levels, but for a given panel, only a handfull

Re: [R] New project: littler for GNU R

2006-09-26 Thread Dirk Eddelbuettel
On 26 September 2006 at 13:14, Gabor Grothendieck wrote: | Any plans for Windows? Someone with deeper knowledge of the Windows build process would need to help us. Interested? Dirk -- Hell, there are no rules here - we're trying to accomplish something.

Re: [R] creation of new variables

2006-09-26 Thread Mike Nielsen
You may not have told us quite enough to be able to help you. It may be worth your while investing some time in describing the problem you are trying to solve a little bit more comprehensively. The posting guide http://www.R-project.org/posting-guide.html can be useful in helping you frame a

Re: [R] New project: littler for GNU R

2006-09-26 Thread Seth Falcon
Wow, looks neat. OS X users will be unhappy with your naming choice as the default filesystem there is not case-sensitive :-( IOW, r and R do the same thing. I would expect it to otherwise work on OS X so a change of some sort might be worthwhile. + seth

[R] How to Pack a matrix

2006-09-26 Thread Guenther, Cameron
Hello, Suppose I have a matrix a where a= sp1 sp2 sp3 sp4 sp5 sp6 site1 1 0 1 1 0 1 site2 1 0 1 1 0 1 site3 1 1 1 1 1 1 site4 0

Re: [R] New project: littler for GNU R

2006-09-26 Thread Jeffrey Horner
Seth Falcon wrote: Wow, looks neat. OS X users will be unhappy with your naming choice as the default filesystem there is not case-sensitive :-( IOW, r and R do the same thing. I would expect it to otherwise work on OS X so a change of some sort might be worthwhile. (I'm always amazed

Re: [R] dotplot, dropping unused levels of 'y'

2006-09-26 Thread Deepayan Sarkar
On 9/26/06, Benjamin Tyner [EMAIL PROTECTED] wrote: Deepayan Sarkar wrote: On 9/15/06, Benjamin Tyner [EMAIL PROTECTED] wrote: In dotplot, what's the best way to suppress the unused levels of 'y' on a per-panel basis? This is useful for the case that 'y' is a factor taking perhaps

Re: [R] How to Pack a matrix

2006-09-26 Thread Gabor Grothendieck
It looks like your example only reorders the columns but your discussion refers to ordering rows too. I have only addressed the columns part but it is hopefully clear how to extend this or use other objective functions. We generate every permutation of the rows and define an objective function f

[R] colClasses: supressed 'NA'

2006-09-26 Thread Anupam Tyagi
Hi, The colClasses seem to be supressing 'NA' vlaues. How do I fix this? R script and first 5 lines of output is below. File test2.dat has blanks that are read as NA when I do not use 'colClasses', but as blanks when I use 'colClasses'. temp.df - read.fwf(test2.dat,

[R] Building R for Windows with ATLAS

2006-09-26 Thread Giuseppe Antonaci
I think this is not a R-devel question. Sorry to all if I'm wrong, please let me know. I managed to build R successfully with the default BLAS but when I change the MKRULES to use ATLAS BLAS and set the path to C:/cygwin/home/Administrador/ATLAS/lib/WinNT_ATHLONSSE2 I got the following error

Re: [R] creation of new variables

2006-09-26 Thread Ritwik Sinha
Depends on what these variables are. Are these vectors? if so a simple a*b etc should work. If they are columns of a data frame DF? then DF$a*DF$b. If these variables are part of a function then also a*b should work. On 9/26/06, nalluri pratap [EMAIL PROTECTED] wrote: Hello All, I have 8

Re: [R] colClasses: supressed 'NA'

2006-09-26 Thread David Barron
Because by default blank fields aren't considered to be missing in factors but they are in integer vectors. f1-factor(c(1,2,,3,4)) f1 [1] 1 2 3 4 Levels: 1 2 3 4 I think you can fix this by specifying na.strings=c(NA,) On 26/09/06, Anupam Tyagi [EMAIL PROTECTED] wrote: Hi, The

Re: [R] New project: littler for GNU R

2006-09-26 Thread Duncan Murdoch
On 9/26/2006 1:04 PM, Jeffrey Horner wrote: What ? == littler - Provides hash-bang (#!) capability for R (www.r-project.org) Why ? = GNU R, a language and environment for statistical computing and graphics, provides a wonderful system for 'programming with data'

Re: [R] colClasses: supressed 'NA'

2006-09-26 Thread Uwe Ligges
Anupam Tyagi wrote: Hi, The colClasses seem to be supressing 'NA' vlaues. How do I fix this? R script and first 5 lines of output is below. File test2.dat has blanks that are read as NA when I do not use 'colClasses', but as blanks when I use 'colClasses'. Well, you say it should be

Re: [R] New project: littler for GNU R

2006-09-26 Thread Dirk Eddelbuettel
On 26 September 2006 at 15:48, Duncan Murdoch wrote: | On 9/26/2006 1:04 PM, Jeffrey Horner wrote: | It can be used directly on the command-line just like, say, bc(1): | | | $ echo 'cat(pi^2,\n)' | r | 9.869604 | | Is there a technical reason that this couldn't work

Re: [R] New project: littler for GNU R

2006-09-26 Thread Chris Lawrence
On 9/26/06, Seth Falcon [EMAIL PROTECTED] wrote: Wow, looks neat. OS X users will be unhappy with your naming choice as the default filesystem there is not case-sensitive :-( IOW, r and R do the same thing. I would expect it to otherwise work on OS X so a change of some sort might be

Re: [R] New project: littler for GNU R

2006-09-26 Thread Richard M. Heiberger
I like this plan and have now played with the concept. I did the following on Windows in cygwin. It would also work in Unix, and I think could be tickled to work on the standard MS cmd line in Windows. It would certainly work on Windows with a Windows-native port of the basic unix utilities.

Re: [R] New project: littler for GNU R

2006-09-26 Thread Gabor Grothendieck
The way it should work IMHO is that one can write any of these (in analogy to awk/perl/etc.): R -f myprog.R mydata.dat R -f myprog.R mydata.dat cat mydata.dat | R -f myprog.R # or analogously on Windows R -e ...some.R.code... mydata.dat R -e ...some.R.code... mydata.dat and there should be a

[R] 5 binary_class models vs one 5-class model

2006-09-26 Thread Weiwei Shi
Hi, I apologize this question is not very r-related, but believe many people using R are expertised at or interested to know the answer to the following question. I am having a problem in classification. In bioinformatics study, we always ends with a limited size of samples. While in algorithms,

Re: [R] New project: littler for GNU R

2006-09-26 Thread Prof Brian Ripley
On Tue, 26 Sep 2006, Richard M. Heiberger wrote: I like this plan and have now played with the concept. I did the following on Windows in cygwin. It would also work in Unix, and I think could be tickled to work on the standard MS cmd line in Windows. It would certainly work on Windows

Re: [R] New project: littler for GNU R

2006-09-26 Thread Deepayan Sarkar
On 9/26/06, Richard M. Heiberger [EMAIL PROTECTED] wrote: I like this plan and have now played with the concept. I did the following on Windows in cygwin. It would also work in Unix, and I think could be tickled to work on the standard MS cmd line in Windows. It would certainly work on

Re: [R] colClasses: supressed 'NA'

2006-09-26 Thread Anupam Tyagi
Uwe Ligges ligges at statistik.uni-dortmund.de writes: Well, you say it should be a factor, hence is taken as a level. And why not a level. Thanks for drawing my attention to it. It is common mistake that is easy to slip attention. Thanks a lot. Anupam.

[R] Lattice strip labels for two factors

2006-09-26 Thread Joe Moore
Dear All: In the following code which I modified from previous question, in addition to show the fact1 level names (y, b, r) in strips, I also want to have a color bar to indicate the state of every panel (in this example, y correspods to 1, and b, r correspond to 0). Does anyone have a quick

Re: [R] Lattice strip labels for two factors

2006-09-26 Thread Deepayan Sarkar
On 9/26/06, Joe Moore [EMAIL PROTECTED] wrote: Dear All: In the following code which I modified from previous question, Perhaps you should also have checked if it runs after the modification. in addition to show the fact1 level names (y, b, r) in strips, I also want to have a color bar to

[R] Bug in formals-

2006-09-26 Thread Frank E Harrell Jr
I think this is new since a previous version of R: h - function(x, trantab) trantab[x] w - 6:4 names(w) - c('cat','dog','giraffe') w cat dog giraffe 6 5 4 formals(h) - list(x=numeric(0), trantab=w) h function (x = numeric(0), trantab = c(6, 5, 4))

Re: [R] Bug in formals-

2006-09-26 Thread Deepayan Sarkar
On 9/26/06, Frank E Harrell Jr [EMAIL PROTECTED] wrote: I think this is new since a previous version of R: h - function(x, trantab) trantab[x] w - 6:4 names(w) - c('cat','dog','giraffe') w cat dog giraffe 6 5 4 formals(h) - list(x=numeric(0),

Re: [R] Bug in formals-

2006-09-26 Thread Gabor Grothendieck
This seems to be related to using c to define transtab. If we use list in place of c then it displays ok: h - function(x, trantab) transtab[x] formals(h) - list(x = numeric(0), transtab = c(cat = 6, dog = 5)) print(h) # bad display function (x = numeric(0), transtab = c(6, 5)) transtab[x]

Re: [R] New project: littler for GNU R

2006-09-26 Thread Jeffrey Horner
Duncan Murdoch wrote: On 9/26/2006 1:04 PM, Jeffrey Horner wrote: [...] It can be used directly on the command-line just like, say, bc(1): $ echo 'cat(pi^2,\n)' | r 9.869604 Is there a technical reason that this couldn't work by modifying the script that invokes

Re: [R] New project: littler for GNU R

2006-09-26 Thread Jeffrey Horner
Seth Falcon wrote: Jeffrey Horner [EMAIL PROTECTED] writes: [...] littler will install into /usr/local/bin by default, so I don't think there's a clash with the Mac binary provided by CRAN, right? It depends what you mean by clash :-) If both are on the PATH, then you get the first one,

Re: [R] New project: littler for GNU R

2006-09-26 Thread Gabor Grothendieck
The real problem is that one wants to pipe the data in, not the R source. The idea is that one successively transforms the data in successive elements of the pipeline. For example one might want to write cut, grep, etc. in R rather than in C. This has been on my year-end wishlist for some time.

[R] matrix with additional upper, botton, left and right cells

2006-09-26 Thread Milton Cezar
Dear R Gurus, I have a matrix dim(1000x1000) and I need create a second matrix with dim(1002x1002) and insert my first matrix at position col=2,line=2. Please, see an example below: 0050055050 555000 5000505005 5005000500 000555 and I need

Re: [R] New project: littler for GNU R

2006-09-26 Thread Dirk Eddelbuettel
On 26 September 2006 at 22:17, Gabor Grothendieck wrote: | The real problem is that one wants to pipe the data in, not the | R source. The idea is that one successively transforms the | data in successive elements of the pipeline. But that is what our filesize example does:: | On 9/26/06,

Re: [R] matrix with additional upper, botton, left and right cells

2006-09-26 Thread jim holtman
How about something like this: x - matrix(1:100,10) x.1 - array(-3, dim=c(12,12)) x.1[2:11, 2:11] - x x.1 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -3 -3 -3 -3 -3 -3 -3 -3 -3-3-3-3 [2,] -31 11 21 31 41 51 61 71

[R] histogram colors in lattice

2006-09-26 Thread Jamie Jarabek
I have code that constructs a plot using the lattice package that looks something like the following toy example: library(lattice) Start - factor(rbinom(100,1,.5)) Answer - 2 - rbinom(100,1,.7) histogram(~Answer | Start, breaks=c(1, 1.4 ,1.6,2),

Re: [R] histogram colors in lattice

2006-09-26 Thread Gabor Grothendieck
Try this: library(lattice) set.seed(1) ## added for reproducibility Start - factor(rbinom(100,1,.5)) Answer - 2 - rbinom(100,1,.7) histogram(~Answer | Start, breaks=c(1, 1.4 ,1.6,2), scales=list(x=list(at=c(1.2,1.8),labels=c(Yes,No))), panel = function(x, ...,