[R] Extracting overdispersion estimates from lmer amd glm objects

2006-09-12 Thread Toby Gardner
Dear list, I am needing to extract the estimate of overdispersion (deviance / residual degrees of freedom or c-hat) from multiple model objects - so they can then be used to compare the extent of overdispersion among alternative models as well as calculate qausi-AIC values. I have been

Re: [R] Command equivalent of rgui File, Save to File?

2006-09-12 Thread Duncan Murdoch
On 9/11/2006 3:57 PM, Michael Prager wrote: R 2.3.1 on Windows XP Professional. I am writing some scripts to generate examples. The Rgui menu item File, Save to File is helpful. Is there perhaps an equivalent R function that can be incorporated into a script? I think sink() is the closest

Re: [R] Test internet presence

2006-09-12 Thread Ted Harding
On 11-Sep-06 Gregor Gorjanc wrote: Thank you. Your solution is usable but unfortunatelly not portable to Windows. I would like to use this test in package check, which can include also windows OS. Now that I think about it (should have done that earlier), you can use the value of

Re: [R] Installation difficulty with rimage

2006-09-12 Thread Prof Brian Ripley
On Mon, 11 Sep 2006, John Kornak wrote: Thanks to Professor Ripley and Sarah Goslee for their helpful responses which have progressed my installation of rimage a little further. Installing fftw2 instead of fftw3 of course solves the problem and I apologize for initially missing that

Re: [R] Test internet presence

2006-09-12 Thread Gregor Gorjanc
Prof Brian Ripley ripley at stats.ox.ac.uk writes: ... Check out tests/internet.R. nsl() checks if you can resolve host names, which has worked well enough there. Thank you prof. Ripley for this pointer. I am posting here the relevant part if someone does not look at SVN. I would just like to

Re: [R] plotting curves

2006-09-12 Thread Ben Bolker
Aldo Crossa aldo.crossa at wright.edu writes: Hi, I've been trying to recreate plots of that follow a cubic form. [snip] I've noticed that in R all curves are pixelated, regardless of howmany points I use. Is there anything I can do to smoothen these graphs so that they are no longer

Re: [R] syntax of nlme

2006-09-12 Thread Spencer Graves
in line Douglas Bates wrote: On 9/11/06, Thomas Wutzler [EMAIL PROTECTED] wrote: Hello, How do I specify the formula and random effects without a startup object ? I thought it would be a mixture of nls and lme. after trying very hard, I ask for help on using nlme. Can someone hint me

Re: [R] dotchart() help

2006-09-12 Thread Prof Brian Ripley
On Tue, 12 Sep 2006, Alexander Nervedi wrote: Hi I am having trouble with dotcharts, and I keep getting the error message: Error in Summary.data.frame(..., na.rm = na.rm) : only defined on a data frame with all numeric or complex variables I am sure there is a really simple

Re: [R] Description of x-axis

2006-09-12 Thread Christian Oswald
Thanks, that works but what are the coordinates of at in the y-direction? On which y-position mtext plots? Christian Jeff Bricker schrieb: ?mtext, also ?barplot since barplot returns midpoints of the bars. also ?rep for setting up a vector of repeating values. something like this:

Re: [R] Description of x-axis

2006-09-12 Thread Uwe Ligges
Christian Oswald wrote: Thanks, that works but what are the coordinates of at in the y-direction? On which y-position mtext plots? Please read ?mtext which tells you to use argument line. Uwe Ligges Christian Jeff Bricker schrieb: ?mtext, also ?barplot since barplot returns

Re: [R] rename cols

2006-09-12 Thread Anupam Tyagi
Christos Hatzis christos at nuverabio.com writes: Try this: old.colnames - colnames(my.439.vars.df) old.colnames[old.colnames==fksm] - new.name.a old.colnames[old.colnames==klmk] - new.name.b For a newcomer, it will be useful to have a function like this in the base R: that can take a

[R] Can't run nlme with nested structure

2006-09-12 Thread Pekka Kontiainen
Hello! So, my problem is following. I have bird offspring growth data and I'd like to model individual growth curves (aim is to study asymptotes and inflection points) with nlme according to Pinheiro Bates 2000: first using nlsList to generate individual curves and then nlme to study the

Re: [R] Successive Graphs

2006-09-12 Thread Berton Gunter
... or use lattice and splom() instead. If the successive graphs bear some relationship to each other, this might produce a more useful display, too. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning

Re: [R] Reading fixed column format

2006-09-12 Thread Anupam Tyagi
Jason Barnhart jasoncbarnhart at msn.com writes: These posts may be helpful. http://tolstoy.newcastle.edu.au/R/help/05/06/5776.html https://stat.ethz.ch/pipermail/r-help/2002-May/021145.html Using scan directly may also work for you rather than read.fwf. Also, there are posts regarding

Re: [R] Extracting overdispersion estimates from lmer amd glm objects

2006-09-12 Thread Simon Blomberg
summary(modeltest)@sigma Toby Gardner wrote: Dear list, I am needing to extract the estimate of overdispersion (deviance / residual degrees of freedom or c-hat) from multiple model objects - so they can then be used to compare the extent of overdispersion among alternative models as

[R] stepAIC

2006-09-12 Thread stephenc
Hi I hope this isn't off topics, but I have always found when I stepAIC() some glm I get an improvement in accuracy and kappa, but I have just done a case where I got a marginal deterioration. Is this possible, or should I be going through my figures carefully to see if I have messed up?

Re: [R] Extracting overdispersion estimates from lmer amd glm objects

2006-09-12 Thread David Barron
You can extract it from a summary.lmer object, which has a slot names sigma that contains this scale parameter. For example, sum.modeltest - summary(modeltest) [EMAIL PROTECTED] On 11/09/06, Toby Gardner [EMAIL PROTECTED] wrote: Dear list, I am needing to extract the estimate of

Re: [R] stepAIC

2006-09-12 Thread Prof Brian Ripley
On Tue, 12 Sep 2006, stephenc wrote: Hi I hope this isn't off topics, but I have always found when I stepAIC() some glm I get an improvement in accuracy and kappa, but I have just done a case where I got a marginal deterioration. Is this possible, or should I be going through my

Re: [R] Installation difficulty with rimage

2006-09-12 Thread John Kornak
Thanks to Professor Ripley and Sarah Goslee for their helpful responses which have progressed my installation of rimage a little further. Installing fftw2 instead of fftw3 of course solves the problem and I apologize for initially missing that requirement in the rimage documentation. My

[R] Problem with geweke.diag

2006-09-12 Thread ralph . wirth
Dear R-users, I have some problems with the geweke.diag-Function of the coda-package. I try to obtain the Geweke-diagnostic by using the following, simple code: library(coda) input.geweke = as.mcmc(input.matrix)#input.matrix is a 25.000 x 35 matrix with the 25.000 saved draws

Re: [R] Can't run nlme with nested structure

2006-09-12 Thread Andrew Robinson
Hello Pekka, there may be a way around it. However, you should provide commented, minimal, self-contained, reproducible code so we can see what you are trying to do. We need to see exactly what you are telling R, and what nlme is telling you. Cheers Andrew On Tue, Sep 12, 2006 at 09:49:28AM

Re: [R] Extracting overdispersion estimates from lmer amd glm objects

2006-09-12 Thread David Barron
PS, the equivalent for a glm is: sum.modeltest - summary(modeltest) sum.modeltest$dispersion Hope this helps. On 11/09/06, Toby Gardner [EMAIL PROTECTED] wrote: Dear list, I am needing to extract the estimate of overdispersion (deviance / residual degrees of freedom or c-hat) from

Re: [R] Reading fixed column format

2006-09-12 Thread Michael Kubovy
On Sep 12, 2006, at 2:47 AM, Anupam Tyagi wrote: Jason Barnhart jasoncbarnhart at msn.com writes: These posts may be helpful. http://tolstoy.newcastle.edu.au/R/help/05/06/5776.html https://stat.ethz.ch/pipermail/r-help/2002-May/021145.html Using scan directly may also work for you rather

Re: [R] Reading fixed column format

2006-09-12 Thread Barry Rowlingson
Michael Kubovy wrote: Please consider saving your data in a way that will make it easier to read into R. No program can read every dataset. going back to the original post, there seems to be a couple of hanging questions: None of these seem to read non-coniguous variables from columns; or

[R] Gnuplot epslatex format also in R?

2006-09-12 Thread Paul Smith
Dear All Is there some way of exporting R plots to epslatex, i.e., to a file with the eps file and another one with the LaTeX commands (representing the text in the plots), likewise Gnuplot does? If so, could you please indicate it to me? Thanks in advance, Paul

Re: [R] Gnuplot epslatex format also in R?

2006-09-12 Thread Stefan Grosse
I did an eps/ps file with e.g.: postscript(c:/Temp/test.eps, width = 8.0, height = 6.0, horizontal = FALSE, onefile = FALSE, paper = special) curve(x^2) dev.off() but I am not sure what you mean with the second file with the latex commands. Paul Smith schrieb: Dear All Is there some way of

Re: [R] Gnuplot epslatex format also in R?

2006-09-12 Thread Prof Brian Ripley
On Tue, 12 Sep 2006, Paul Smith wrote: Is there some way of exporting R plots to epslatex, i.e., to a file with the eps file and another one with the LaTeX commands (representing the text in the plots), likewise Gnuplot does? If so, could you please indicate it to me? R has an xfig driver,

[R] Help understanding how nls parses the formula argument to estimate the model

2006-09-12 Thread Joe Byers
I could use some help understanding how nls parses the formula argument to a model.frame and estimates the model. I am trying to utilize the functionality of the nls formula argument to modify garchFit() to handle other variables in the mean equation besides just an arma(u,v) specification.

[R] nls

2006-09-12 Thread mzabalazo ngwenya
Hello everyone ! I am trying to write a short program to estimate semivariogram parameters. But I keep running into a problem when using the nls function. Could you please shed some light. I have put a sample of one of the codes and ran a short example so you see what I mean. -

Re: [R] Reading fixed column format

2006-09-12 Thread Petr Pikal
Hi Well. I use R quite extensively for a quite a long time without knowing perl, cut, awk etc. Do you think I shall learn it? I agree with Barry Rowlingson that best way how to get a correct answer is to present all relevant information. Seems to me that read.table, read.fwf are obvious

[R] nls

2006-09-12 Thread mzabalazo ngwenya
Hello everyone ! I am trying to write a short program to estimate semivariogram parameters. But I keep running into a problem when using the nls function. Could you please shed some light. I have put a sample of one of the codes and ran a short example so you see what I mean. -

Re: [R] rename cols

2006-09-12 Thread Petr Pikal
Hi On 12 Sep 2006 at 6:44, Anupam Tyagi wrote: To: r-help@stat.math.ethz.ch From: Anupam Tyagi [EMAIL PROTECTED] Date sent: Tue, 12 Sep 2006 06:44:03 + (UTC) Subject:Re: [R] rename cols Christos Hatzis christos at

Re: [R] rename cols

2006-09-12 Thread Doran, Harold
I don't know, this seems pretty simple and intuitive (to me) # Create a sample data set with 439 variables tmp - data.frame(matrix(c(rnorm(4390)), ncol=439)) colnames(tmp)-paste(col, 1:439, sep = ) # rename a certain variable in that dataset names(tmp)[(which(names(tmp)=='col1'))]-'NewName'

Re: [R] rename cols

2006-09-12 Thread hadley wickham
For a newcomer who wants to rename variable fksm and klmk in a dataframe of with 439 variables there is not easy and intuitive solution. That person has to spend a lot of time listing columns and counting columns or doing string searches or using brackets within brackets within brackets to

[R] lattice cloud and conditional axis limits

2006-09-12 Thread Karl Ove Hufthammer
I'm using the 'cloud' function in the 'lattice' package to produce multi-panel 3D scatter plots. The range of the values used vary much between each panel (especially on the z axis), so I wish the axis limits to be calculated based on the (conditional) data. Here's a minimal example:

Re: [R] rename cols

2006-09-12 Thread Petr Pikal
Hi There is even an Excel like possibility for renaming columns. try newDF-edit(oldDF) you can go through columns and after clicking on header you can change column name. Petr On 12 Sep 2006 at 8:31, hadley wickham wrote: Date sent: Tue, 12 Sep 2006 08:31:43 -0400 From:

[R] (no subject)

2006-09-12 Thread Anders Eklund
Hi, I have a problem with aggregate. x - aggregate(t1,list(t2,t3,t4), mean) z-x[,3] I want z to be a vector but it is a factor. I've tried to use as.vector(z,mode=numeric) but then the numbers get scrambeled. Any help is appriciated /anders __

Re: [R] Gnuplot epslatex format also in R?

2006-09-12 Thread Paul Smith
On 9/12/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: Is there some way of exporting R plots to epslatex, i.e., to a file with the eps file and another one with the LaTeX commands (representing the text in the plots), likewise Gnuplot does? If so, could you please indicate it to me? R

[R] Kendall's tau-c

2006-09-12 Thread Knut Wenzig
Hello, I can't find a package which calculates Kendall's tau-c. There is the package Kendall, but it only calcuates Kendall's tau-b. Here is the example from ttp://www2.chass.ncsu.edu/garson/pa765/assocordinal.htm. cityriots - data.frame(citysize=c(1,1,2,2,3,3), riotsize=c(1,2,1,2,1,2),

Re: [R] factor to numeric (no subject)

2006-09-12 Thread Petr Pikal
Hi all culumns which are used for discrimination (in your case 3) are factor. If you want to change them to numeric you has to use as.numeric(as.character(x[,3])) I believe it is in FAQ. HTH Petr Please use sensible subject. On 12 Sep 2006 at 14:49, Anders Eklund wrote: Date sent:

[R] Fwd: (no subject)

2006-09-12 Thread David Barron
From the FAQ: 7.10 How do I convert factors to numeric? It may happen that when reading numeric data into R (usually, when reading in a file), they come in as factors. If f is such a factor object, you can use as.numeric(as.character(f)) to get the numbers back. More efficient, but harder

Re: [R] Test internet presence

2006-09-12 Thread Gregor Gorjanc
Gabor Grothendieck wrote: Here is a variation for Windows. The second line returns TRUE or FALSE and may need to be varied if the output of ping is not the same on your system as on mine: ping - system(ping www.google.com, intern = TRUE) as.numeric(strsplit(grep(Received, ping, value =

Re: [R] Kendall's tau-c

2006-09-12 Thread Marc Schwartz
On Tue, 2006-09-12 at 15:02 +0200, Knut Wenzig wrote: Hello, I can't find a package which calculates Kendall's tau-c. There is the package Kendall, but it only calcuates Kendall's tau-b. Here is the example from ttp://www2.chass.ncsu.edu/garson/pa765/assocordinal.htm. cityriots -

[R] Using XY location data to calculate ecological parameters

2006-09-12 Thread James R. Milks
Dear R gurus, I have XY data giving the locations of tree seedlings that were surveyed during a 210 meter belt transect. This belt transect was taken by stretching a line across the field, then measuring all seedlings within 1 meter on either side of the line. The end result was XY

Re: [R] Command equivalent of rgui File, Save to File?

2006-09-12 Thread Duncan Murdoch
On 9/12/2006 9:27 AM, Michael Prager wrote: Duncan Murdoch wrote: On 9/11/2006 3:57 PM, Michael Prager wrote: R 2.3.1 on Windows XP Professional. I am writing some scripts to generate examples. The Rgui menu item File, Save to File is helpful. Is there perhaps an equivalent R

Re: [R] Using XY location data to calculate ecological parameters

2006-09-12 Thread ONKELINX, Thierry
Assuming you only use the X direction to split the data into 10 m cells. table(list(Species, round(X, digits = -1))) This will generate a table with the number of seedlings per species in each 10 m cell. Divide this by the area of each cell and you get the densities. Cheers, Thierry

Re: [R] Conservative ANOVA tables in lmer

2006-09-12 Thread Douglas Bates
On 9/11/06, Manuel Morales [EMAIL PROTECTED] wrote: On Mon, 2006-09-11 at 11:43 -0500, Douglas Bates wrote: On 9/10/06, Andrew Robinson [EMAIL PROTECTED] wrote: On Thu, Sep 07, 2006 at 07:59:58AM -0500, Douglas Bates wrote: I would be happy to re-institute p-values for fixed effects

Re: [R] Installation difficulty with rimage

2006-09-12 Thread John Kornak
Thanks again to both Sarah Goslee and Professor Ripley. Installing the libjpeg-devel package was the key. John Sarah Goslee wrote: Well, there are two possible problems. One, you don't have the file. Two, it isn't where it's supposed to be. Did you install it from the rpm? If so, did

[R] levels of factor when subsetting the factor

2006-09-12 Thread Afshartous, David
All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say forming the key in a plot. The data is correct, but the variable still remembers the original levels. See below for reproducible code. Does anyone know how to fix this?

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Doran, Harold
Just add the following to your code new.fact = fact[1:6, drop=T] new.fact [1] A A A B B B Levels: A B -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Afshartous, David Sent: Tuesday, September 12, 2006 11:23 AM To: r-help@stat.math.ethz.ch

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread David Barron
Try new.fact = fact[1:6, drop=TRUE] On 12/09/06, Afshartous, David [EMAIL PROTECTED] wrote: All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say forming the key in a plot. The data is correct, but the variable still

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Liaw, Andy
You have at least two choices: R factor(fact[1:6]) [1] A A A B B B Levels: A B R fact[1:6, drop=TRUE] [1] A A A B B B Levels: A B HTH, Andy From: Afshartous, David All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Douglas Bates
On 9/12/06, Afshartous, David [EMAIL PROTECTED] wrote: All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say forming the key in a plot. The data is correct, but the variable still remembers the original levels. See below for

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Roger D. Peng
I think you want 'fact[1:6, drop = TRUE]' -roger Afshartous, David wrote: All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say forming the key in a plot. The data is correct, but the variable still remembers the original

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread ONKELINX, Thierry
factor(new.fact) will do the trick. But that will recode the levels and that might be something you don't want. fact = as.factor(c(rep(A, 3),rep(B, 3), rep(C, 3))) new.fact = fact[1:6] new.fact [1] A A A B B B Levels: A B C factor(new.fact) [1] A A A B B B Levels: A B Cheers, Thierry

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Doran, Harold
Also, it is probably easier to use gl() than coerce your data into a factor fact - gl(3, 3, label = c(A, B, C)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Liaw, Andy Sent: Tuesday, September 12, 2006 11:32 AM To: Afshartous, David;

Re: [R] Command equivalent of rgui File, Save to File?

2006-09-12 Thread Michael Prager
Duncan Murdoch wrote: On 9/11/2006 3:57 PM, Michael Prager wrote: R 2.3.1 on Windows XP Professional. I am writing some scripts to generate examples. The Rgui menu item File, Save to File is helpful. Is there perhaps an equivalent R function that can be incorporated into a script?

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Dimitris Rizopoulos
check ?[.factor, you need: fact[1:6, drop = TRUE] Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web:

Re: [R] Test internet presence

2006-09-12 Thread Prof Brian Ripley
On Mon, 11 Sep 2006, Gregor Gorjanc wrote: Prof Brian Ripley ripley at stats.ox.ac.uk writes: ... Check out tests/internet.R. nsl() checks if you can resolve host names, which has worked well enough there. Thank you prof. Ripley for this pointer. I am posting here the relevant part

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Afshartous, David
thanks to all for the quick replies! if the factor is part of a dataframe, I can apply the subsetting to the entire dataframe, and then use drop=True to the factor separately and then put it back into the new dataframe (code below). is there a way to do this in a single step? dat

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Peter Dalgaard
Afshartous, David [EMAIL PROTECTED] writes: All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say forming the key in a plot. The data is correct, but the variable still remembers the original levels. See below for

[R] coerce matrix to number

2006-09-12 Thread Simone Gabbriellini
Dear List, how can I coerce a matrix like this [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 1 1 0 0 0 [2,] 1 0 1 0 0 0 [3,] 1 1 0 0 0 0 [4,] 0 0 0 0 1 0 [5,] 0 0 0 1 0 0 [6,] 0 0 0 0 0 0 to be filled with numbers? this is the result of replacing some character (v,

[R] Plotting in R within NX client

2006-09-12 Thread Martin Percossi
Hello, has anyone tried doing this? Local System: NX client (windows version) Remote System: Linux Fedora Core 5, running on 64 bit Intel R 2.3.1 The plots display weird in the sense that the y-labels don't show, i.e. they appear as solid black rectangles rather than numbers. I know the

[R] Use of xvfb : X11 cannot allocate additional graphics colors. Consider using colortype=pseudo.cube or gray

2006-09-12 Thread Gael Even
Hi, I use R in remote access on a Debian server. I need X11() to create graphical things so I use xvfb-run (Virtual X server environnement) R to allowing X11() capabilities to R. An other technique is to connect in shh -X to execute my R script. With the connection ssh -X, my R script is well

[R] References about dot a files

2006-09-12 Thread Sender
Hello: I'm trying to find some reading material about .a files. I'm attempting to build a package which accesses many C routines via .Call, and its been suggested that I need a lib_C_code.a file inside the C directory. What does such a file do? Where can I read somthing about it? I've tried

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Sundar Dorai-Raj
Yes. I do this periodically: dat.new - dat[1:6, ] dat.new[] - lapply(dat.new, function(x) if(is.factor(x)) factor(x) else x) HTH, --sundar Afshartous, David said the following on 9/12/2006 11:00 AM: thanks to all for the quick replies! if the factor is part of a

Re: [R] coerce matrix to number

2006-09-12 Thread Marc Schwartz (via MN)
On Tue, 2006-09-12 at 18:42 +0200, Simone Gabbriellini wrote: Dear List, how can I coerce a matrix like this [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 1 1 0 0 0 [2,] 1 0 1 0 0 0 [3,] 1 1 0 0 0 0 [4,] 0 0 0 0 1 0 [5,] 0 0 0 1 0 0 [6,] 0 0 0 0 0 0 to be

Re: [R] coerce matrix to number

2006-09-12 Thread Jacques VESLOT
if only 2 letters: (z==v)*1 else: lapply(z, function(x) as.numeric(as.character(factor(x,levels= c(d,v,w),labels=c(0,1,2) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille

[R] how to install R-2.3.1 on Mac OS X 10.3.9?

2006-09-12 Thread Lei Wu
Hi, is there anyone knows how to install R-2.3.1 on Mac OS X 10.3.9(panther)? Thanks a lot! Lei __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] coerce matrix to number

2006-09-12 Thread Simone Gabbriellini
Marc, wpw, great, what a lot of solutions!!! thank you very much, simone Il giorno 12/set/06, alle ore 19:21, Marc Schwartz (via MN) ha scritto: On Tue, 2006-09-12 at 18:42 +0200, Simone Gabbriellini wrote: Dear List, how can I coerce a matrix like this [,1] [,2] [,3] [,4] [,5]

Re: [R] rename cols

2006-09-12 Thread Ethan Johnsons
Thank you so much!! ej On 9/11/06, Tony Plate [EMAIL PROTECTED] wrote: The following works for data frames and matrices (you didn't say which you were working with). x - data.frame(V1=1:3,V2=4:6) x V1 V2 1 1 4 2 2 5 3 3 6 colnames(x) - c(Apple, Orange) x Apple Orange

[R] extract a value from vector

2006-09-12 Thread Ethan Johnsons
A quick question, please! How do you extract a certain value of vector? i.e. x = c(2,5,3,6,21,3,6,24, ) How do you get the 1st one (which is 2); the 5th one (which is 21); etc? thx much, ej [[alternative HTML version deleted]] __

Re: [R] Use of xvfb : X11 cannot allocate additional graphics colors. Consider using colortype=pseudo.cube or gray

2006-09-12 Thread Prof Brian Ripley
It's a known problem. Run the X11 device with the arguments stated, as it says On Tue, 12 Sep 2006, Gael Even wrote: Hi, I use R in remote access on a Debian server. I need X11() to create graphical things so I use xvfb-run (Virtual X server environnement) R to allowing X11()

Re: [R] extract a value from vector

2006-09-12 Thread David Barron
I'm not quite sure what you mean. To get the first item in a vector you use x[1] [1] 2 x[5] [1] 21 Is that what you want? On 12/09/06, Ethan Johnsons [EMAIL PROTECTED] wrote: A quick question, please! How do you extract a certain value of vector? i.e. x = c(2,5,3,6,21,3,6,24, )

Re: [R] extract a value from vector

2006-09-12 Thread Paul Smith
On 9/12/06, Ethan Johnsons [EMAIL PROTECTED] wrote: A quick question, please! How do you extract a certain value of vector? i.e. x = c(2,5,3,6,21,3,6,24, ) How do you get the 1st one (which is 2); the 5th one (which is 21); etc? Simple, Ethan: x[1], x[5], ... Paul

Re: [R] Use of xvfb : X11 cannot allocate additional graphics colors. Consider using colortype=pseudo.cube or gray

2006-09-12 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: It's a known problem. Run the X11 device with the arguments stated, as it says Alternatively, try playing with the pixel depth of xvfb. I think this mainly happens with 8-bit displays. On Tue, 12 Sep 2006, Gael Even wrote: Hi, I

[R] About truncated distribution

2006-09-12 Thread jennystadt
Hi All, I tried RSiteSearch('truncated distribution') , and found a lot of threads on 'fitting truncated normal distribution'. No doubt they are all helpful in fitting the distribution based on the data of known original mean and sd. But my question is a bit different. What I know is the mean

Re: [R] Test internet presence

2006-09-12 Thread Gregor Gorjanc
Prof Brian Ripley wrote: On Mon, 11 Sep 2006, Gregor Gorjanc wrote: Prof Brian Ripley ripley at stats.ox.ac.uk writes: ... Check out tests/internet.R. nsl() checks if you can resolve host names, which has worked well enough there. Thank you prof. Ripley for this pointer. I am posting here

Re: [R] rgl: exporting to pdf or png does not work

2006-09-12 Thread Daniel Franke
[This is a follow-up to the recent discussion on R-help] Hi all, I can reproduce both problems on gentoo (2006.0 profile), but not on OpenSuSE-10.1. bash cat rgl.postscript.r library(rgl) example(spheres3d) rgl.postscript(spheres.eps, fmt=eps) R source(rgl.postscript.r) X Error of failed

[R] whole object approach for nested loops

2006-09-12 Thread T C
I have the following code that I am trying to execute using the whole object approach and get rid of the for loop. I have looked at the manual and seached the database for examples or similar questions with no luck. The following example works without any problems. for (j in 1:186) {

Re: [R] summary(glm) for categorical variables

2006-09-12 Thread John Vokey
You want: anova(my.glm) On 12-Sep-06, at 4:00 AM, [EMAIL PROTECTED] wrote: Suppose we have a data.frame where variables are categorical and the response is categorical eg: my.df=NULL for(i in LETTERS[1:3]){my.df[[i]]=sample(letters, size=10)} my.df=data.frame(my.df)

[R] variables in object names

2006-09-12 Thread Pierce, Ken
Is there any way to put an argument into an object name. For example, say I have 5 objects, model1, model2, model3, model4 and model5. I would like to make a vector of the r.squares from each model by code such as this: rsq - summary(model1)$r.squared for(i in 2:5){ rsq - c(rsq,

[R] Bitmap file size problems

2006-09-12 Thread Erich Neuwirth
I am experiencing some problems with the windows graphics device and bitmaps. (Everything is done in R 2.3.1 on Windows XP) As an example, I will use windows(3,2) plot(1:10) It is not a pretty or meaningful graph, but it demonstrates the problem. savePlot(file=test,type=bmp) creates a bitmap

Re: [R] variables in object names

2006-09-12 Thread Sarah Goslee
Hi Ken, Not quite the way you're thinking about it, but yes, there is, and it is very useful. See ?get for more information, but here's the basics: for(i in 2:5) { thismodel - get(paste(model, i, sep=)) rsq - c(rsq, summary(thismodel)$r.squared) } Also see ?assign for the opposite effect.

Re: [R] variables in object names

2006-09-12 Thread Wensui Liu
Ken, I have a similar example in my blog: http://statcompute.spaces.live.com/blog/cns!39C8032DBD1321B7!229.entry On 9/12/06, Pierce, Ken [EMAIL PROTECTED] wrote: Is there any way to put an argument into an object name. For example, say I have 5 objects, model1, model2, model3, model4 and

Re: [R] variables in object names

2006-09-12 Thread Dimitrios Rizopoulos
you need something like the following, fit.lis - list(model1, model2, model3, model4, model5) # or if you have many models fit.lis - lapply(paste(model, 1:5, sep = ), get) sapply(fit.lis, function(x) summary(x)$r.squared) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student

Re: [R] variables in object names

2006-09-12 Thread Pierce, Ken
Thanks to all who showed me to the get() function. That works like a charm. Ken From: David Barron [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 1:24 PM To: Pierce, Ken; r-help Subject: Re: [R] variables in object names The trick is to use the

Re: [R] variables in object names

2006-09-12 Thread David Barron
The trick is to use the function get(): vns - paste(model,1:4,sep=) x - rnorm(10) model1 - lm(rnorm(10) ~ x) model2 - lm(rnorm(10) ~ x) model3 - lm(rnorm(10) ~ x) model4 - lm(rnorm(10) ~ x) r.sq - summary(model1)$r.square for (i in 2:4) r.sq - c(r.sq,summary(get(vns[i]))$r.square) On

[R] error in make check

2006-09-12 Thread Seaclear Theory
Hi! I got error when I did make check: running code in 'reg-tests-1.R' .../bin/sh: line 1: 9538 Segmentation fault LC_ALL=C SRCDIR=. R_DEFAULT_PACKAGES= ../bin/R --vanilla reg-tests-1.R reg-tests-1.Rout 21 make[3]: *** [reg-tests-1.Rout] Error 1 make[3]: Leaving directory

[R] Basic help needed: group bunch of lines in a list (matrix)

2006-09-12 Thread Emmanuel Levy
Hello, I'd like to group the lines of a matrix so that: A 1.0 200 A 3.0 800 A 2.0 200 B 0.5 20 B 0.9 50 C 5.0 70 Would give: A 2.0 400 B 0.7 35 C 5.0 70 So all lines corresponding to a letter (level), become a single line where all the values of each column are averaged. I've done that with a

Re: [R] Basic help needed: group bunch of lines in a list (matrix)

2006-09-12 Thread Sundar Dorai-Raj
Emmanuel Levy said the following on 9/12/2006 3:50 PM: Hello, I'd like to group the lines of a matrix so that: A 1.0 200 A 3.0 800 A 2.0 200 B 0.5 20 B 0.9 50 C 5.0 70 Would give: A 2.0 400 B 0.7 35 C 5.0 70 So all lines corresponding to a letter (level), become a single line

Re: [R] whole object approach for nested loops

2006-09-12 Thread Richard M. Heiberger
you are looking for the outer product ?outer a - 1:6 cc - matrix(1:6, 3, 2) e - matrix(0, 6,3) for (j in 1:3) e[,j] - a*cc[j,2] e [,1] [,2] [,3] [1,]456 [2,]8 10 12 [3,] 12 15 18 [4,] 16 20 24 [5,] 20 25 30 [6,] 24 30 36 a %o% cc[,2]

[R] About truncated distribution

2006-09-12 Thread jennystadt
Dear listers, I tried RSiteSearch('truncated distribution') , and found a lot of threads on 'fitting truncated normal distribution'. No doubt they are all helpful in fitting the distribution based on the data of known original mean and sd. But my question is a bit different. What I know is the

Re: [R] Conservative ANOVA tables in lmer

2006-09-12 Thread Andrew Robinson
On Tue, September 12, 2006 7:34 am, Manuel Morales wrote: On Mon, 2006-09-11 at 11:43 -0500, Douglas Bates wrote: Having made that offer I think I will now withdraw it. Peter's example has convinced me that this is the wrong thing to do. I am encouraged by the fact that the results from

Re: [R] About truncated distribution

2006-09-12 Thread Berton Gunter
But my question is a bit different. What I know is the mean and sd after truncation. If I assume the distribution is normal, how I am gonna develope the original distribution using this two parameters? You can't, as they are plainly not sufficient (you need to know the amount of

Re: [R] About truncated distribution

2006-09-12 Thread Ritwik Sinha
However, if you know the point(s) of truncation then you should be able to work your way back. Look for the mean and variance of a truncated normal, it will involve mu, sigma and c (point of truncation). You will need to solve for mu and sigma from two equation. For example look at the wikipedia

Re: [R] lattice cloud and conditional axis limits

2006-09-12 Thread Deepayan Sarkar
On 9/12/06, Karl Ove Hufthammer [EMAIL PROTECTED] wrote: I'm using the 'cloud' function in the 'lattice' package to produce multi-panel 3D scatter plots. The range of the values used vary much between each panel (especially on the z axis), so I wish the axis limits to be calculated based on

Re: [R] wireplot margins and additional z-axis

2006-09-12 Thread Deepayan Sarkar
On 9/12/06, Klaus Nordhausen [EMAIL PROTECTED] wrote: Dear Deepayan, thanks for your reply, the change of the aspect does however not solve my problem with the space below the graph on the .eps I attached the .eps (still with the old aspect) so that it is maybe clearer what my problem is.

Re: [R] Bootstrapping for Firth bias reduction logistic regression

2006-09-12 Thread ssim
Dear list, I want to validate the coefficients computed from Firth bias reduction ligistic regression using bootstrap resampling method. However, I got an error message which I coule not decipher. Help is needed Error in if (mx 1) delta - delta/mx : missing value where TRUE/FALSE needed

[R] Updating lmer - object is not subsettable?

2006-09-12 Thread Jarrett Byrnes
I'm attempting to write a general function to implement Faraway's bootstrapping algorithm for mixed models with lmer, but have run into a curious problem. I'm comparing two models model.1-lmer(Response ~ Treatment + (1|Trial), data=exp.data, method=ML) model.2-lmer(Response ~ 1 +

  1   2   >