[R] rbugs on linux and wine
Hi List, I trying an example from pumps{rbugs} with .Renviron in $HOME adjusted for my box: WINE="/usr/bin/wine", BUGS="/usr/local/bin/WinBugs14/winbugs.exe" data(pumps) pumps.data <- list(t = pumps$t, x = pumps$x, N = nrow(pumps)) pumps.model <- file.path(.path.package("rbugs"), "bugs/model", "pumps.bug") #file.show(pumps.model) pumps.inits <- file.path(.path.package("rbugs"), "bugs/inits", "pumps.txt") #file.show(pumps.inits) inits <- list(dget(pumps.inits)) parameters <- c("theta", "alpha", "beta") pumps.sim <- rbugs(data = pumps.data, inits, parameters, pumps.model, n.chains = 1, n.iter = 1000, workingDir="tmp", bugsWorkingDir="tmp", #WINE="/usr/bin/wine", #BUGS="/usr/local/bin/openbugs/winbugs.exe", useWine=TRUE) ## End(Not run) I get " error in rbugs(data=pumps.data,inits,parameters, pumps.model,n.chains=1: wine executable does not exists. " However, /usr/bin/wine /usr/local/bin/WinBugs14/winbugs.exe starts up winbugs. I am running opensuse 10.3 with R 2.6.2 (2007-11-26), winbugs 1.4.3 (6th August, 2007). Any ideas on what goes wrong? Thanks Herry Dr Alexander Herr - Herry CSIRO, Sustainable Ecosystems Gungahlin Homestead Bellenden Street GPO Box 284 Crace, ACT 2601 Phone/www (02) 6242 1542; 6242 1705(fax) 0408679811 (mob) home: www.csiro.au/people/Alexander.Herr Webadmin ABS: http://ausbats.org.au Sustainable Ecosystems: www.cse.csiro.au Dr Alexander Herr - Herry CSIRO, Sustainable Ecosystems Gungahlin Homestead Bellenden Street GPO Box 284 Crace, ACT 2601 Phone/www (02) 6242 1542; 6242 1705(fax) 0408679811 (mob) home: www.csiro.au/people/Alexander.Herr Webadmin ABS: http://ausbats.org.au Sustainable Ecosystems: www.cse.csiro.au __ R-help@r-project.org 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, self-contained, reproducible code.
[R] readAsciiGrid memory issues
Hi List, I am unable to read in a 7.8Gb ascii grid using readAsciiGrid {maptools} - R runs out of memory. I have 4Gb ram and 4Gb swap, so things are getting tight. I am wondering if anyone has alternative options (preferably with example) that enable to read in large grids, do some calculations and save a new grid? I am running linux 64bit on opensuse11 and R 2.8.0 Thanx Herry __ R-help@r-project.org 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, self-contained, reproducible code.
[R] fontsize in mosaic plot lables
Hi List, I am trying unsucessfully to modify the fontsize of lables in mosaic: require(vcd) mosaic(Titanic, pop=FALSE, labeling_args=list(rot_labels=c(bottom=90,top=90), set_varnames = c(Sex = "Gender"), gp_text=gpar(fontsize=20))) #can't get it to resize text tab <- ifelse(Titanic < 6, NA, Titanic) # it works for labeling_cells labeling_cells(text = tab, margin = 0,gp_text=gpar(fontsize=20))(Titanic) What am I doing wrong? Thanx Herry __ R-help@r-project.org 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, self-contained, reproducible code.
Re: [R] fontsize in mosaic plot lables
Thanks Patric, mosaic{vdc} takes gpar parameters. So cex.axis does not work for mosaic(Titanic, pop=FALSE, labeling_args=list(rot_labels=c(bottom=90,top=90),cex.axis=0.5)) or mosaic(Titanic, pop=FALSE, labeling_args=list(rot_labels=c(bottom=90,top=90)),cex.axis=0.5) However, mosaic(Titanic, pop=FALSE, labeling_args=list(rot_labels=c(bottom=90,top=90),gp_labels=(gpar(fontsi ze=5 works for all labels. Is there a way to adjust only one set of axis labels? Thanx and cheers Herry -Original Message- From: Patrick Connolly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 20, 2007 7:15 AM To: Herr, Alexander Herr - Herry (CSE, Townsville); [EMAIL PROTECTED] Subject: RE: [R] fontsize in mosaic plot lables > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Wednesday, 19 September 2007 2:04 p.m. > To: [EMAIL PROTECTED] > Subject: [R] fontsize in mosaic plot lables > > Hi List, > > I am trying unsucessfully to modify the fontsize of lables in mosaic: > > > require(vcd) > mosaic(Titanic, pop=FALSE, > labeling_args=list(rot_labels=c(bottom=90,top=90), > set_varnames = c(Sex = "Gender"), > gp_text=gpar(fontsize=20))) #can't get it to resize text > > tab <- ifelse(Titanic < 6, NA, Titanic) # it works for labeling_cells > labeling_cells(text = tab, margin = > 0,gp_text=gpar(fontsize=20))(Titanic) > > What am I doing wrong? The mosaic function isn't part of lattice. Try cex.axis in a more or less normal way instead of gpar settings. HTH ___ The contents of this e-mail are privileged and/or confidenti...{{dropped}} __ R-help@r-project.org 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, self-contained, reproducible code.
[R] special characters in linux using dev.print
Hi List, I want to print ± in a lattice graph label. This works in windows, but the linux version has problems - it cannot translate the character. Error is "invalid input in mbcsToLatin1". I use the standard encoding and also dev.print(file="filename",dev=pdf, encoding="PDFDoc.enc") I am afraid I don't know enough about the linux font encodings to figure out what to use. So I am hoping others using ± have already come across the trap. Any help appreciated. Thanks Herry Using x86_64 opensuse 10.2, R2.5.0 (2007-04-23) __ R-help@r-project.org 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, self-contained, reproducible code.
Re: [R] special characters in linux using dev.print
Thanks Brian, I got lost with the coding between windows and linux. I used the ± (Windows: Alt-0177, instead of "\u00B1") in a code writen under windows and than used on linux. eg: plot(1:10) text(3,8,paste("±", "alt-numeric 0177 works only in windows",sep="")) text(8,3,paste("\u00B1"," \\u00B1 works on both platforms",sep="")) Cheers Herry -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Monday, October 08, 2007 4:36 PM To: Herr, Alexander Herr - Herry (CSE, Townsville) Cc: [EMAIL PROTECTED] Subject: Re: [R] special characters in linux using dev.print How exactly are you doing this (see the footer of your message for the input we asked for)? What is your 'minimal, self-contained, reproducible code', and where is the output of sessionInfo()? The plusminus symbol is in the symbol font, and it is also in some text encodings, so there are several routes you could have taken. For example, pdf() plot(1:10) text(4,5,"\u00B1") works for me in a UTF-8 locale. (It works in any locale that has the symbol in its encoding.) On Mon, 8 Oct 2007, [EMAIL PROTECTED] wrote: > Hi List, > > I want to print ± in a lattice graph label. This works in windows, but > the linux version has problems - it cannot translate the character. > Error is "invalid input in mbcsToLatin1". > > I use the standard encoding and also dev.print(file="filename",dev=pdf, > encoding="PDFDoc.enc") > > I am afraid I don't know enough about the linux font encodings to figure > out what to use. So I am hoping others using ± have already come across > the trap. > > Any help appreciated. > Thanks > Herry > > Using x86_64 opensuse 10.2, R2.5.0 (2007-04-23) > > __ > R-help@r-project.org 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, self-contained, reproducible code. > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org 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, self-contained, reproducible code.
[R] adjust labels in plot:terminal_panel {party}
Hi List, I am unsuccessfully trying to beautify barplot outputs from ctree. For example I would like to rotate x-axis lables and resize/change font/type. mtree <- ctree(ME ~ ., data = mammoexp) plot(mtree,terminal_panel=node_barplot(mtree,col="black",fill=NULL, beside=TRUE, ylines=NULL, widths=1,gap=NULL, reverse=FALSE,id=FALSE)) plot(mtree,terminal_panel=node_barplot(mtree,col="black",fill=NULL, beside=TRUE, ylines=NULL, widths=1,gap=NULL, reverse=FALSE,id=FALSE, gp_labels=gpar(fontsize=20, rot_labels=90) ) ) Any help appreciated Thanks Herry __ R-help@r-project.org 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, self-contained, reproducible code.
[R] hierarchical clustering - variable selection
Hi List, I am looking for a procedure that allows selection of variables in a clustering attempt. Specifically I am searching for a way of selecting out noise variables from a set of numeric/categorical variables (or of course selecting "non-noise" variables). The procedure should work with gower/ward metric/method. So far I have only found procedures that deal with numerical variables. Any hints to packages/procedure would be appreciated Thanks Herry __ R-help@r-project.org 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, self-contained, reproducible code.
Re: [R] hierarchical clustering - variable selection
Maybe I haven't been sufficiently clear on what I am after: I am looking for R adaptations of approaches (relevant to hierarchical clustering of categorical variables) described in Steinley and Brusco 2008 "Selection of variables in cluster analysis: an empirical comparison of eight procedures" Psychometrika, 73,1, 125-144 Thanx Herry -Original Message- From: Dylan Beaudette [mailto:dylan.beaude...@gmail.com] Sent: Wednesday, July 01, 2009 2:01 PM To: Herr, Alexander Herr - Herry (CSE, Gungahlin) Cc: r-help@r-project.org Subject: Re: [R] hierarchical clustering - variable selection varclust() in the Hmisc package might be what you are looking for. Dylan On Tue, Jun 30, 2009 at 7:27 PM, wrote: > > Hi List, > > I am looking for a procedure that allows selection of variables in a > clustering attempt. > > Specifically I am searching for a way of selecting out noise variables from a > set of numeric/categorical variables (or of course selecting "non-noise" > variables). > > The procedure should work with gower/ward metric/method. So far I have only > found procedures that deal with numerical variables. > > Any hints to packages/procedure would be appreciated > > Thanks > Herry > > __ > R-help@r-project.org 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, self-contained, reproducible code. > __ R-help@r-project.org 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, self-contained, reproducible code.
[R] stepwise variable selection method wanted
Hi List, I am looking for a variable selection procedure with a forward-backward selection method. Firstly, it is meant to work with the cophenetic correlation coefficient (CPCC) and intended to find the variable combination with the highest cophenetic correlation. Secondly, it is aimed at Gower metric with wards method (though this could be easily extended) aimed at categorical data. What I have so far is a function for backward selection that returns the variables deleted and associated CPCC. My current approach is cumbersome and very slow when working with large data sets (mostly because of the proximity matrix calculation). There are also problems with using only backward selection, so a way of combining forward-backward would be much better. I was hoping that someone has a better /faster selection procedure that can be adapted to using the CPCC. Below my backward selection function and example. Thanks and cheers Herry require(cluster) cophenCbw<-function(dta){ # cophenetic variable selection backward if(!is.data.frame(dta)) {print("x must be a dataframe with variables as columns, cases as rows")} else if(ncol(dta) <3) {pring("input dataframe must have at least 3 columns")} else { #currently function only performs cophenC on gower with ward, but this can be adjusted easily to other metrics/methods require(cluster) require(ade4) dta->dta.sic lhs<-dta for(j in 1:ncol(dta)){ print(paste("round", j)) as.data.frame(matrix(ncol=4, nrow=0))->testm for(i in 0:ncol(lhs)) { if(i == 0){ daisy(lhs, metric="gower")->d.all agnes(lingoes(d.all),method="ward")->agnes.d.all cophenetic(agnes.d.all)->d1 cor(d1,d.all)->cc testm<-data.frame(varID=0,cophenC=round(cc,3),varsdel=NA,round=0) } else { daisy(lhs[,-i], metric="gower")->d.all agnes(lingoes(d.all),method="ward")->agnes.d.all cophenetic(agnes.d.all)->d1 cor(d1,d.all)->cc testm<-rbind(testm,data.frame(varID=i,cophenC=round(cc,3),varsdel=colnames(dta)[i],round=j)) #print(paste("var", i, "out of",ncol(lhs),"nrows", nrow(lhs),"rowsInTestm:",nrow(testm))) } } if(j == 1) { testm[testm[,2] == min(testm[,2]),][1,]->varsdel#use only the first if there are several vars2del<-varsdel[j,3] lhs<-dta[,-which(colnames(dta) %in% vars2del)] print(paste("var2delete",varsdel[j,1],varsdel[j,3],"cophenC=",varsdel[j,2],"rowsInTestm:",nrow(testm))) } # put exclusion variable into record else { rbind(varsdel,testm[testm[,2] == min(testm[,2]),])->varsdel vars2del<-rbind(vars2del,varsdel[j,3]) lhs<-dta[,-which(colnames(dta) %in% vars2del)] print(paste("var2delete",varsdel[j,1],varsdel[j,3],"cophenC=",varsdel[j,2],"rowsInTestm:",nrow(testm))) } if(is.na(varsdel[j,3])) break } } return(varsdel) } cophenCbw(plantTraits) __ R-help@r-project.org 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, self-contained, reproducible code.