Re: [R] lda source code
Frank Gibbons wrote: Wei Geng, I asked the same question about six weeks ago, so let me try to answer it. The source for the entire package 'MASS' is in a single file, I believe (at least this is true on my Linux setup). The thread gets boring, but let me correct this belief: NO! There is one file including all R code, if you are looking into the binary installation of a package, and then the C/Fortran sources are not more visible. Look into the source distribution of a package for a more structured view of things! Uwe Ligges The exact location of that file you'll have to determine by searching the directory/folder where you installed it. The function 'lda' is implemented entirely in R itself, like much of its functionality. Look at the functions 'lda' and 'predict.lda' in this file for details. Comments are sparse in most R code, from what I gather, but if you look in Pattern Recognition and Neural Networks by Brian Ripley (one of the authors of this package), you'll find a discussion in section 2.4 'Predictive classification' that covers much of what's going on, from what I've been able to glean. I hope that helps. There are certainly others out there who are more au fait with this than me. -Frank Gibbons At 05:47 PM 10/1/2003, you wrote: Wei Geng wrote: I am new to R. Trying to find out how lda() {in MASS R1.8.0 Windows} was implemented in R. Does anyone know where to find out lda source code ? Thanks. Here: http://cran.r-project.org Hint: MASS is a *package*. You want to view its *source*. Same with most other R packages. Or just about anything else you want to know about R. Cheers Jason -- Indigo Industrial Controls Ltd. http://www.indigoindustrial.co.nz 64-21-343-545 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PhD, Computational Biologist, Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA. Tel: 617-432-3555 Fax: 617-432-3557 http://llama.med.harvard.edu/~fgibbons __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] install from source again
Erin Hodgess wrote: What does Error 255 stand for in the make bitmapdll, please? It depends. Some more lines of the error message would be helpful. Did have put the required sources (jpeg-6b, libpng) at the correct loactions in order to make the bitmapdll? Uwe Ligges Thanks, erin [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] trouble with R com and python
hi there i tried to use R from python my pc is an intel 1600 with win98; python is python 2.2; R is rw1062, and R (D)COM Server V1.2 when i use the sample code provided in the readme.html, no problem, but when i try to read a file, a get a traceback error (please see code enclosed) has anyone ever tried to read file using python, or send commands from libraries (MASS...) ? is there a tutorial for Rcom ( well, i tried to find one with google, but it didn't work :-(( ) thanks in advance ;-) regards emmanuel the python code is the following : --- --- Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type copyright, credits or license for more information. IDLE 0.8 -- press F1 for help from win32com.client import Dispatch sc=Dispatch(StatConnectorSrv.StatConnector) sc.Init(R) res = sc.Evaluate(2+2) res 4.0 res = sc.Evaluate(library(modreg)) sc.Evaluate(library(modreg)) (u'methods', u'ctest', u'mva', u'modreg', u'nls', u'ts', u'base') sc.Evaluate(library(MASS)) (u'MASS', u'methods', u'ctest', u'mva', u'modreg', u'nls', u'ts', u'base') # no pb till here!! ###but if i try to read a file sc.Evaluate('do-read.table(c:/data.txt, header=TRUE)') Traceback (most recent call last): File pyshell#11, line 1, in ? sc.Evaluate('do-read.table(c:/data.txt, header=TRUE)') File COMObject StatConnectorSrv.StatConnector, line 2, in Evaluate File C:\PYTHON22\lib\site-packages\win32com\client\dynamic.py, line 237, in _ApplyTypes_ result = apply(self._oleobj_.InvokeTypes, (dispid, LCID, wFlags, retType, argTypes) + args) com_error: (-2147352567, 'Une exception est apparue.', (0, None, None, None, 0, -2147221500), None) nota bene: : Une exception est apparue.means an exception occured __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] permission problem on R install
Erin Hodgess wrote: Dear R People: Here is the exact sequence of events: Making package base adding build stamp to DESCRIPTION C:/rsource/R-1.7.1/bin/rterm.exe: permission denied Do you have the *recent* version of the tool set from Brian Ripley's page? Do you use tar to unpack the sources? Look into the permissions of the directory/files, sometimes strange permissions are related to inheritance of permissions from a main directory, and look for the reason why you don't have access to the file. MAKE[2]:***[C:/rsource/R-1.7.1/library/base/] Error 126 MAKE[1]:***[pkg-base] Error 2 MAKE:***[rpackage] Error 2 Also, I'm using version 2.0.0-3.exe of Mingw. I tried the most recent version, and it got hung up because of changes in the type sizes. This doesn't make sense, does it? No, if you have cleaned the sources with make clean before. Compiling with MinGW's gcc-3.3.1 works perfectly, at least for R-1.8.0 beta. Uwe Ligges Thanks, Erin mailto: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] R on fairly large machines
Allan Tingey [EMAIL PROTECTED] writes: Hi, We are considering using R on a large problem that will require four 64 bit cpu's and 64Gb of ram and some flavor of unix. We are just wondering if R is going to be happy in this environment. If have experience with this please let me know. You're probably going into uncharted territory at least to some extent, but various people have been gathering experiences with 64-bit platforms. I'm not rich enough to have hands-on experience, but my impression is that things are quite dependent on the precise platform. The free software OS's are generally quite well standardized so that you can use (near-)standard procedures to get going. The commercial ones will require some elbow grease to get compiler switches and library settings right, and to get various support libraries (readline, jpeg, bz, etc.) in place. Then again, there are preciously few platforms that support that kind of memory size - I know that Sun will, but the speeds that I have seen from their CPUs have not been impressive. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] fitting Markov chains
Tamas == Tamas Papp [EMAIL PROTECTED] on Wed, 1 Oct 2003 17:14:51 +0200 writes: Tamas I need to find a computationally simple process for the movement of Tamas interest rates. In this simplified model, an interest rate can have Tamas 3--5 possible values, and its movement is characterized by a matrix of Tamas transition probabilities (ie, it is a Markov process). Tamas I would like to estimate this process from a given set of data. Tamas For example, let the interest rate time series be: Tamas 7 3 8 2 5 9 6 Tamas Assume that the discretized variable can take the following values: Tamas (3, 5, 8), then we find the nearest discrete point and give its index: Tamas 3 1 3 1 2 3 2 Tamas Then estimate the transition probabilities. Tamas I have the following questions: Tamas - how should I select the discrete set of values that the variable can Tamas assume? Eg simply get the maximum and minimum, and divide this Tamas interval into, say, three pieces? Or estimate the mean, and make the Tamas other two values mean plus-minus one standard deviation? (see below) Tamas - once the variable is discretized, how do I Tamas transform each data point to its discretized value Tamas (its index)? that's the trivial part of answering your questions: Use cut() Tamas - the most important: how should I estimate the transition Tamas probabilities? We (mainly Peter Buhlmann and his coworkers) have had good experiences with discretizing such financial time series and then fitting so called Variable Length Markov Chains (VLMCs). To your 1st question: When doing so, one easy (and robust!) approach was to use the sample quantiles (of the marginal distribution), e.g. use the three quartiles, quantile(x, prob = (1:3)/4) as cut points {in cut(), above}. Much less easy is to determine how *many* values you want to chose for cutting. I think they have rarely used many pieces, sometimes even had good results with binary discretization --- iff used with VLMCs. So this comes back to the question of model estimation. A VLMC does *not* assume first-order Markov {as you do above}, but rather allows to look further back into the past, something quite realistic in some cases. Now the VL part, Variable Length is the novel idea of a past the length of which *depends* on your current state (context). There's the CRAN package VLMC (http://cran.r-project.org/src/contrib/PACKAGES.html#VLMC) and we have an applied paper Mächler, M. and Bühlmann, P. (2003). Variable Length Markov Chains: Methodology, Computing and Software. To appear in Journal of Computational and Graphical Statistics. a pre-version of which you can get from http://stat.ethz.ch/Research-Reports/104.html The paper contains references to the fundamental (mathematical) research on this. Tamas References to introductory literature on estimating Markov chains like Tamas this would be welcome. Most importantly, I need to know how robust an Tamas estimation is to selecting the discrete points, or is there a simple Tamas goodness of fit estimation. Using quantiles instead of mean/sd for chosing cut points is certainly robust. one goodness of fit (GOF) measure we (also use with VLMCs) is `the' AIC (-2 log likelihood). However you can only use it to compare nested models; which doesn't help you here (I think) for chosing the number of cutpoints. More applied is to use predictions {from a fitted model} and compare them with the actual values. Because of discretization you get a confusion matrix on which you can consider quite a few different GOF measures. For realistic GOF measurement you also need to do something like crossvalidation which in its simplest case would be to work with training and testing data. The whole topic is not at all trivial. We had one Ph.D. thesis on this (plus extensions..). Hoping this helps. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] pmatch questions
Dear all, Below there are two, simple - I suppose, questions on using pmatch(): pmatch(xx, c(cc,xxa)) [1] 2 pmatch(a, c(cc,xxa)) [1] NA pmatch(xx, c(cc,xxa,xxb)) [1] NA I would like that the second call returns also 2, and the third call returns c(2,3) is it possible? many thanks vito __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
AW: [R] pmatch questions
Hi, This is maybe not a really nice solution but it gives you what you want which(regexpr(a, c(cc,xxa))!=-1) 2 which(regexpr(xx, c(cc,xxa,xxb))!=-1) 2 3 HTH Thomas -Ursprüngliche Nachricht- Von: Vito Muggeo [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 2. Oktober 2003 11:04 An: [EMAIL PROTECTED] Betreff: [R] pmatch questions Dear all, Below there are two, simple - I suppose, questions on using pmatch(): pmatch(xx, c(cc,xxa)) [1] 2 pmatch(a, c(cc,xxa)) [1] NA pmatch(xx, c(cc,xxa,xxb)) [1] NA I would like that the second call returns also 2, and the third call returns c(2,3) is it possible? many thanks vito __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] pmatch questions
Vito Muggeo wrote: Dear all, Below there are two, simple - I suppose, questions on using pmatch(): pmatch(xx, c(cc,xxa)) [1] 2 pmatch(a, c(cc,xxa)) [1] NA pmatch(xx, c(cc,xxa,xxb)) [1] NA I would like that the second call returns also 2, and the third call returns c(2,3) is it possible? You are looking for grep(). Uwe Ligges many thanks vito __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] r editors
On Thu, 2 Oct 2003, forkusam wrote: I am programming on a windows system and have problems using notepad which is my main editor.Each time I try to open the editor from the R IDE, R crashes. Not sure what you meant by R IDE, do you mean Rgui? CAn someone tell me if I am doing anything wrong or is there a better editor(freeware) which I could get. If you are really programming in R, you really should get Emacs/ESS -- Cheers, Kevin -- On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question. -- Charles Babbage (1791-1871) From Computer Stupidities: http://rinkworks.com/stupid/ -- Ko-Kang Kevin Wang Master of Science (MSc) Student SLC Tutor and Lab Demonstrator Department of Statistics University of Auckland New Zealand Homepage: http://www.stat.auckland.ac.nz/~kwan022 Ph: 373-7599 x88475 (City) x88480 (Tamaki) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] r editors
Hi, I can recommend two editors: - Emacs/XEmacs in conjunction with the ESS-package (ESS= Emacs Speaks Statistics). It is free software. However, it takes a while until it is working nicely - especially if you have no experience with Emacs/XEmacs. One of the nice features is that you can run R from within XEmacs (I guess also within Emacs, but I am using XEmacs). Some URLs: http://www.gnu.org/directory/text/editors/emacs.html http://www.xemacs.org http://stat.ethz.ch/ESS/ - WinEdt is not freeware but I think it is a nice working environment if you include Uwe Ligges' plug-in which can be accessed from: http://cran.r-project.org/contrib/extra/winedt/ Best thing is probably to download the shareware version of WinEdt (from www.winedt.com), include the R-WinEdt-plug-in and try out if this setting suits you. Best, Roland -Original Message- From: forkusam [SMTP:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [R] r editors Hi , I am programming on a windows system and have problems using notepad which is my main editor.Each time I try to open the editor from the R IDE, R crashes. So I always have to copy my codes from notepad and paste in R to run them. CAn someone tell me if I am doing anything wrong or is there a better editor(freeware) which I could get. thanks cilver = = Sylvie B. Forkusam Eppelheimer Str.52/A2-5-2 69115 Heidelberg, Germany Tel: (0049)-06221/346913 Mobile: 0179-6816276 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help + This mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] r editors
forkusam wrote: Hi , I am programming on a windows system and have problems using notepad which is my main editor.Each time I try to open the editor from the R IDE, R crashes. I guess it looks like R freezes (and R does *not* crash), because R waits until the editor is closed again. That's happens for every editor. Why don't you start your favorite editor in another way? Uwe Ligges So I always have to copy my codes from notepad and paste in R to run them. CAn someone tell me if I am doing anything wrong or is there a better editor(freeware) which I could get. thanks cilver = = Sylvie B. Forkusam Eppelheimer Str.52/A2-5-2 69115 Heidelberg, Germany Tel: (0049)-06221/346913 Mobile: 0179-6816276 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] r editors
On Thu, 2 Oct 2003 02:56:11 -0700 (PDT), you wrote: Hi , I am programming on a windows system and have problems using notepad which is my main editor.Each time I try to open the editor from the R IDE, R crashes. It shouldn't crash; can you give more details of how you're opening the editor, and what the symptoms of the crash are? One thing that might be happening: if you use edit(myfunction) then Notepad will start, and R will wait for it to finish before doing anything else. It hasn't crashed, but it looks like it has until you shut down Notepad. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Query: What is 'Trellis'?
I'm an R-beginner and have found the function 'panel.mathdensity' in the full manual. R can't find the function and under 'Description' in the manual it says that they are available in Trellis. What is it and where can I find the function? Regards, Mrten Mrten Bjellerup Doctoral Student in Economics School of Management and Economics Vxj University SE-351 95 Vxj Sweden Tel: +46 470 708410 Fax: +46 470 82478 Mobile: +46 70 969 88 88 Mail: [EMAIL PROTECTED] Web: http://www.ehv.vxu.se - Forecasting is like trying to drive a car blindfolded and following directions given by a person who is looking out of the back window __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
R: [R] r editors
In addition to WinEdt and (X)Emacs of course, See also, http://www.crimsoneditor.com/ (freeware) http://www.jedit.org/ (freeware) http://www.editpadpro.com/ (non-freeware) I know that there exist Syntax Highlighting files for R, but I don't know where you can find them. best, vito - Original Message - From: forkusam [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 02, 2003 11:56 AM Subject: [R] r editors Hi , I am programming on a windows system and have problems using notepad which is my main editor.Each time I try to open the editor from the R IDE, R crashes. So I always have to copy my codes from notepad and paste in R to run them. CAn someone tell me if I am doing anything wrong or is there a better editor(freeware) which I could get. thanks cilver = = Sylvie B. Forkusam Eppelheimer Str.52/A2-5-2 69115 Heidelberg, Germany Tel: (0049)-06221/346913 Mobile: 0179-6816276 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] [[-,[[ default?
Hi! I have implemented class specific behaviour of [[-.myclass-function(). How it is posible to call the [[.default on an object of myclass? Eryk Dipl. bio-chem. Eryk Witold Wolski@MPI-MG Dep. Vertebrate Genomics Ihnestrasse 73 14195 Berlin 'v' tel: 0049-30-84131285 / \ mail: [EMAIL PROTECTED]---W-W [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] var on a vector
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am an R newbie. I have a problem with computing a variance on a vector. data(cars) variance - function (x) mean(x^2)-mean(x)^2; variance(cars[,1]) [1] 27.4 var(cars[,1]) [1] 27.95918 What did I assume/understand wrong ? You wrongly assumed that the 'var' help file would not help. However, that page states that the denominator n-1 is used. 27.4*50/49 [1] 27.95918 -- Philippe __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] multi-dimensional hash
Hello, I was wondering what's the best data structure in R for a multi-dimensional lookup table, and how to implement it. I've several categories say A, B, C ... and within each of these categories there are other categories such as a, b, c, ... . There can be up to 5 dimensions. The actual value for [A][a]... is then a vector. I'm looking forward to any suggestions, +thanks very much for your help, Arne __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] var on a vector
[EMAIL PROTECTED] schrieb: Hello I am an R newbie. I have a problem with computing a variance on a vector. data(cars) variance - function (x) mean(x^2)-mean(x)^2; variance(cars[,1]) [1] 27.4 var(cars[,1]) [1] 27.95918 What did I assume/understand wrong ? TIA Hello, help(var) says: The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations. Try: n - length(cars[,1]) var(cars[,1])*(n-1)/n Matthias Kohl __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Query: What is 'Trellis'?
You need to load the `lattice' library in R. Try library(lattice) panel.mathdensity function (dmath = dnorm, args = list(mean = 0, sd = 1), n = 50, col, col.line = reference.line$col, lwd = reference.line$lwd, lty = reference.line$lty, ...) { reference.line - trellis.par.get(reference.line) if (!missing(col)) { if (missing(col.line)) col.line - col } x - do.breaks(endpoints = current.viewport()$xscale, nint = n) y - do.call(dmath, c(list(x = x), args)) llines(x = x, y = y, col = col.line, lwd = lwd, lty = lty, ...) } Mrten Bjellerup wrote: I'm an R-beginner and have found the function 'panel.mathdensity' in the full manual. R can't find the function and under 'Description' in the manual it says that they are available in Trellis. What is it and where can I find the function? Regards, Mrten Mrten Bjellerup Doctoral Student in Economics School of Management and Economics Vxj University SE-351 95 Vxj Sweden Tel: +46 470 708410 Fax: +46 470 82478 Mobile: +46 70 969 88 88 Mail: [EMAIL PROTECTED] Web: http://www.ehv.vxu.se - Forecasting is like trying to drive a car blindfolded and following directions given by a person who is looking out of the back window __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] [[-,[[ default?
It depends, but a quick answer is that you in general should use NextMethod() as far as possible to avoid ad hoc solutions and tricky side effects. Example: x - list(a=1:10, b=base::letters); class(x) - ClassA; [[.ClassA - function(object, name) { # Here you are allowed to do something, cf. UseMethod(). name - tolower(name); # e.g. make x[[A]] equal to x[[a]]. NextMethod([[); } If ClassA inherits from ClassB and there is a function [[.ClassB() defined, then this will of course *not* call [[.default(), but [[.ClassB(). However, this what you should expect from a good object-oriented design! Maybe the above answers your question. If not, continue to read. I can't recall the example, but I have indeed seen a case where we wanted to called the default method explicitly. To do this, the only thing you can do is unfortunately to unclass() your object and this could have side effects that you do not want: [[.ClassA - function(object, name) { # Here you are allowed to do something, cf. UseMethod(). name - tolower(name); # e.g. make x[[A]] equal to x[[a]]. unclass(object)[[name]]; } unclass() should normally be avoided since it is a nasty workaround. Probably not in this case with [[, but with other generic functions, it can happen that default method in turn calls other generic functions. Since you have unclassed the object the wrong method will be called by those downstream generic functions. My conclusion is that, and maybe this is what you are fishing for, there should really exist a generic function and a separate default function for [[. What do the R-developers think? The following will of course not work (it will generate an infinite recursive call): [[.ClassA - function(object, name) { # Here you are allowed to do something, cf. UseMethod(). name - tolower(name); # e.g. make x[[A]] equal to x[[a]]. fcn - .Primitive([[); # or fcn - get([[, mode=function); fcn(object, name); } Henrik Bengtsson Lund University -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wolski Sent: den 2 oktober 2003 13:30 To: [EMAIL PROTECTED] Subject: [R] [[-,[[ default? Hi! I have implemented class specific behaviour of [[-.myclass-function(). How it is posible to call the [[.default on an object of myclass? Eryk Dipl. bio-chem. Eryk Witold Wolski@MPI-MG Dep. Vertebrate Genomics Ihnestrasse 73 14195 Berlin 'v' tel: 0049-30-84131285 / \ mail: [EMAIL PROTECTED]---W-W [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo /r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] multi-dimensional hash
Arne - In the past, I've used a data frame for the lookup table and the and of individual logical vectors to select rows from it. Here's a simplified version of the selector function I wrote. My mail editor does not balance parentheses, so I don't guarantee that this version is syntactically correct. Various sanity checks have been omitted for clarity. # return row numbers for the conjunction of matches to multiple # named columns of data. match is to the cross-product of indiv # args and rows are returned in data set order. the values to # select for should be supplied as named arguments in ... . select - function(data, ...) { test - list(...) col.index - match(names(test), names(data), 0) seq(length(data[[1]]))[ apply(sapply(seq(along=test), function(i,d,n,t) match(d[[n[i]]], t[[i]], 0) 0, data, col.index, test), 1, all) ] } In my own code, select() is called by any of several wrapper functions which implement specific queries, and supply the names of the columns on which they want to select. The results from several queries are saved as integer row numbers, then combined and re-sorted before I actually subscript the data frame with them to extract the data. HTH - tom blackwell - u michigan medical school - ann arbor - On Thu, 2 Oct 2003 [EMAIL PROTECTED] wrote: I was wondering what's the best data structure in R for a multi-dimensional lookup table, and how to implement it. I've several categories say A, B, C ... and within each of these categories there are other categories such as a, b, c, ... . There can be up to 5 dimensions. The actual value for [A][a]... is then a vector. I'm looking forward to any suggestions, +thanks very much for your help, Arne __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Doubly Multivariate LME
Dear R: I am trying to fit a doubly multivariate LME (DM) where I have two response variables measured on two occasions per person. Specifically, reading and math scores measured at the beginning and ending of a school year. The response variables have a correlation of r = .85. The response variables in the data matrix are stacked in a vector with a dummy code flagging each outcome and with time variables for each outcome. The model was fit by removing the overall intercept, but creating fixed effects and random effects for each using the following: mult2.lme-lme(fixed=score~-1+read+math+time.m+time.r, data=mult.samp, random=~-1+read+math+time.r+time.m|childid) This worked and seemed to produce reasonable estimates. I then ran a model using only a single outcome (reading) and found that the estimates are very similar, so I am relatively confident in the results of the model. Now, I have a couple of questions regarding the DM LME: 1) If I wanted to explore model assumptions, i.e., homoscedasticity and dependence among the residuals, how might I do this. For example, how might I specify an AR1 structure? I have explored the assumptions in the single response model, but am having trouble now. 2) I presume it is safe to explore the intercepts and slopes using lmList () one variable at a time. Is this correct? 3) The AIC statistic for the single response model is half the size of the DM model. It is my understanding that this statistic is more appropriate than LL test in this scenario. Is this correct? If so, is there a reason that may explain the larger AIC in the DM model? Or, is this indicating that the single response model is a better fit? 4) Last, is there any other issue that I am missing? I may not have asked the question, but would appreciate any suggestions related to the model. Regards, -- Harold C. Doran Director of Research and Evaluation New American Schools 675 N. Washington Street, Suite 220 Alexandria, Virginia 22314 703.647.1628 http://www.edperform.net/ [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] how calculate mean for each group
An alternative to renaming columns in the ouput of aggregate is to provide names in the by list as follows: aggregate(df$treatment, list(gp=df$group, dup=df$duplicate), mean) hope this helps. spencer graves Marc Schwartz wrote: On Wed, 2003-10-01 at 20:15, [EMAIL PROTECTED] wrote: Hello, R experts: I got data like this: group duplicate treatment A Y 5 A Y 3 A N 6 B Y 2 B N 4 B Y 1 How to sort the data and calculate the average treatment value for each group in two level of duplicate. Results like this: group duplicate treatment A Y 4 A N 6 B Y 1.5 B N 4 Thank you in advance. Josh # Create a dataframe df - data.frame(group = c(rep(A, 3), rep(B, 3)), duplicate = c(Y, Y, N, Y, N, Y), treatment = c(5, 3, 6, 2, 4, 1)) # Use aggregate aggregate(df$treatment, list(df$group, df$duplicate), mean) Group.1 Group.2 x 1 A N 6.0 2 B N 4.0 3 A Y 4.0 4 B Y 1.5 Aggregate returns a data frame in this case, so that you can then set the colnames and order the output if you wish. HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Power calculation
HI, I ran into trouble trying to do a power computation. In the presence of interaction, I am simulating clinical trials in multiple centers. Suppose I have 3 centers, each with 20 patients, 10 in active drug and 10 in placebo and I have efficacy data for the 60 patients, ie, initial and final response variable scores for all 60 subjects. How do I compute the power of the study? (May be using an f-test?) Regards Krishna S P __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] how calculate mean for each group
On Thu, 2003-10-02 at 08:47, Spencer Graves wrote: An alternative to renaming columns in the ouput of aggregate is to provide names in the by list as follows: aggregate(df$treatment, list(gp=df$group, dup=df$duplicate), mean) hope this helps. spencer graves SNIP Spencer, Yeah, knew that. Using the above you would get: aggregate(df$treatment, list(gp=df$group, dup=df$duplicate), mean) gp dup x 1 A N 6.0 2 B N 4.0 3 A Y 4.0 4 B Y 1.5 Which still leaves the mean column generically labeled as 'x'. To take it one more step, given the way in which aggregate.data.frame is coded and the way in which df$treatment is passed as a vector, you could use the following to label the mean column as 'treatment': df - data.frame(group = c(rep(A, 3), rep(B, 3)), duplicate = c(Y, Y, N, Y, N, Y), treatment = c(5, 3, 6, 2, 4, 1)) attach(df) aggregate(as.data.frame(treatment), list(group = group, duplicate = duplicate), mean) which yields: group duplicate treatment 1 A N 6.0 2 B N 4.0 3 A Y 4.0 4 B Y 1.5 Remember to 'detach(df)'. Doing it this way, 'treatment' retains the name attribute when passed to aggregate, rather than as a vector. Thanks for pointing that out. Regards, Marc __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Query: weighting cells in histogram
I have the 'breaks' for the histogram ('hist') but I want weight the cells instead of using actual observations. I thought that using freq=FALSE implied that the numbers in 'x' were weights but this turned out to be wrong. Any help and/or comment is very much appreciated. Regards, Mårten Mårten Bjellerup Doctoral Student in Economics School of Management and Economics Växjö University SE-351 95 Växjö Sweden Tel: +46 470 708410 Fax: +46 470 82478 Mobile: +46 70 969 88 88 Mail: [EMAIL PROTECTED] Web: http://www.ehv.vxu.se - Forecasting is like trying to drive a car blindfolded and following directions given by a person who is looking out of the back window __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Query: What is 'Trellis'?
See http://cm.bell-labs.com/cm/ms/departments/sia/project/trellis/ This is implemented in the lattice package in R, which you can load by library(lattice) and perhaps start with help(Lattice) On Thursday 02 October 2003 05:50, Mrten Bjellerup wrote: I'm an R-beginner and have found the function 'panel.mathdensity' in the full manual. Just out of curiosity, which manual would that be ? R can't find the function and under 'Description' in the manual it says that they are available in Trellis. What is it and where can I find the function? Deepayan __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] how calculate mean for each group
A little more succinctly and I hope also helpful: with(df, aggregate(list(mean=treatment), list(group = group, duplicate = duplicate), mean)) Note that the name of the summary of treatment is likely best to be different from the name of the treatment variable itself. It is tempting to do something fancy picking up the name of the called function automatically, but I mostly use an unnamed summary function (x) { ...}, so I won't bother. (BTW did I ever mention here how much I prefer with() to attach()/forget.to.detach() ?) From: Marc Schwartz [mailto:[EMAIL PROTECTED] Sent: 02 October 2003 15:37 attach(df) aggregate(as.data.frame(treatment), list(group = group, duplicate = duplicate), mean) ### Remember to 'detach(df)'. Doing it this way, 'treatment' retains the name attribute when passed to aggregate, rather than as a vector. Simon Fear Senior Statistician Syne qua non Ltd Tel: +44 (0) 1379 69 Fax: +44 (0) 1379 65 email: [EMAIL PROTECTED] web: http://www.synequanon.com Number of attachments included with this message: 0 This message (and any associated files) is confidential and\...{{dropped}} __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Query: weighting cells in histogram
Marten - I don't know exactly what interpretation you have in mind for weights, but if you assign the value of hist() to a variable tmp, you can then assign the component tmp$counts any value you like, and plot the result as a histogram using plot(tmp). See the section Value: in help(hist). - tom blackwell - u michigan medical school - ann arbor - On Thu, 2 Oct 2003, [iso-8859-1] Mårten Bjellerup wrote: I have the 'breaks' for the histogram ('hist') but I want to weight the cells instead of using actual observations. I thought that using freq=FALSE implied that the numbers in 'x' were weights but this turned out to be wrong. Any help and/or comment is very much appreciated. Regards, Mårten Mårten Bjellerup Doctoral Student in Economics School of Management and Economics Växjö University SE-351 95 Växjö Sweden Tel: +46 470 708410 Fax: +46 470 82478 Mobile: +46 70 969 88 88 Mail: [EMAIL PROTECTED] Web: http://www.ehv.vxu.se __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] using a string as the formula in rlm
Hi, I am trying to build a series of rlm models. I have my data frame and the models will be built using various coulmns of the data frame. Thus a series of models would be m1 - rlm(V1 ~ V2 + V3 + V4, data) m2 - rlm(V1 ~ V2 + V5 + V7, data) m3 - rlm(V1 ~ V2 + V8 + V9, data) I would like to automate this. Is it possible to use a string in place of the formula? I tried doing: fmla - sprintf('V1 ~ V%g + V%g + V%g',2,3,4) m1 -rlm(fmla,data) I get: Error in qr(x) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: NAs introduced by coercion I can understand why this method results in the error but is there any way to get around this? Thanks, --- Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE --- Gods are fragile things; they may be killed by a whiff of science or a dose of common sense. -- Chapman Cohen __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Query: weighting cells in histogram
hist returns a list, to which you can apply your weights. Alternatively, in R 1.7.1, typing hist [without the quotes ()] at a commands prompt reveals a call to UseMethod. 'methods(hist)' identifies functions hist.default and hist.POSIXt. Typing hist.default prodused the R code, which you can then customize any way you want. The protocol in R 1.8 for this is different, but the same concepts should apply, I believe. hope this helps. spencer graves Mårten Bjellerup wrote: I have the 'breaks' for the histogram ('hist') but I want weight the cells instead of using actual observations. I thought that using freq=FALSE implied that the numbers in 'x' were weights but this turned out to be wrong. Any help and/or comment is very much appreciated. Regards, Mårten Mårten Bjellerup Doctoral Student in Economics School of Management and Economics Växjö University SE-351 95 Växjö Sweden Tel: +46 470 708410 Fax: +46 470 82478 Mobile: +46 70 969 88 88 Mail: [EMAIL PROTECTED] Web: http://www.ehv.vxu.se - Forecasting is like trying to drive a car blindfolded and following directions given by a person who is looking out of the back window __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] using a string as the formula in rlm
It may help you to read Bill Venables' column in R News http://cran.r-project.org/doc/Rnews/Rnews_2002-2.pdf, pages 24-26. Andy -Original Message- From: Rajarshi Guha [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 11:25 AM To: [EMAIL PROTECTED] Subject: [R] using a string as the formula in rlm Hi, I am trying to build a series of rlm models. I have my data frame and the models will be built using various coulmns of the data frame. Thus a series of models would be m1 - rlm(V1 ~ V2 + V3 + V4, data) m2 - rlm(V1 ~ V2 + V5 + V7, data) m3 - rlm(V1 ~ V2 + V8 + V9, data) I would like to automate this. Is it possible to use a string in place of the formula? I tried doing: fmla - sprintf('V1 ~ V%g + V%g + V%g',2,3,4) m1 -rlm(fmla,data) I get: Error in qr(x) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: NAs introduced by coercion I can understand why this method results in the error but is there any way to get around this? Thanks, --- Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE --- Gods are fragile things; they may be killed by a whiff of science or a dose of common sense. -- Chapman Cohen __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo /r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] how calculate mean for each group
On Thu, 2003-10-02 at 10:11, Simon Fear wrote: A little more succinctly and I hope also helpful: with(df, aggregate(list(mean=treatment), list(group = group, duplicate = duplicate), mean)) Note that the name of the summary of treatment is likely best to be different from the name of the treatment variable itself. It is tempting to do something fancy picking up the name of the called function automatically, but I mostly use an unnamed summary function (x) { ...}, so I won't bother. (BTW did I ever mention here how much I prefer with() to attach()/forget.to.detach() ?) LOL... I supposed that this might be the time to raise the possibility of an Obfuscated R contest? ;-) Thanks Simon. Marc __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] (no subject)
Dear Sir, I am system administrator for sun solaris 2.8. I have no idea about the functioning of the R software. I had installed. I tried testing some of the programs and functions. I read in the manual that plot(x,y) functions automatically generates a graphical window and plot. that does not happens in my installation. Please help me in this regard yours sincerely. Arunkumar __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] using a string as the formula in rlm
Rajarshi Guha wrote: Hi, I am trying to build a series of rlm models. I have my data frame and the models will be built using various coulmns of the data frame. Thus a series of models would be m1 - rlm(V1 ~ V2 + V3 + V4, data) m2 - rlm(V1 ~ V2 + V5 + V7, data) m3 - rlm(V1 ~ V2 + V8 + V9, data) I would like to automate this. Is it possible to use a string in place of the formula? I tried doing: fmla - sprintf('V1 ~ V%g + V%g + V%g',2,3,4) See ?as.formula Uwe Ligges m1 -rlm(fmla,data) I get: Error in qr(x) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: NAs introduced by coercion I can understand why this method results in the error but is there any way to get around this? Thanks, --- Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE --- Gods are fragile things; they may be killed by a whiff of science or a dose of common sense. -- Chapman Cohen __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] r editors
What you want to do is startup up a second window/process separately from R so you have R open in one window and your editor open in another window. When you make a change to the source, just write it out without closing the editor, move to the R window and then source it from R: source(/abc.r) You can grab this line from the command history using up arrow so you don't actually have to type it except the first time. That way you can easily go back and forth between R and your editor. This should work with notepad or with any other editor. While we are on the topic of editors, the free gvim editor available at: http://www.vim.org has R syntax highlighting. It is vi enhanced with a GUI, more powerful command set, and cross platform availability including Windows (which is where I used it). There is also an alternate user interface for it, which I have not used, called cream, available at: http://cream.sourceforge.net --- From: forkusam [EMAIL PROTECTED] Hi , I am programming on a windows system and have problems using notepad which is my main editor.Each time I try to open the editor from the R IDE, R crashes. So I always have to copy my codes from notepad and paste in R to run them. CAn someone tell me if I am doing anything wrong or is there a better editor(freeware) which I could get. thanks cilver ___ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] using a string as the formula in rlm
Have you considered the following: fmla - formula(sprintf('V1 ~ V%g + V%g + V%g',2,3,4)) hope this helps. spencer graves Rajarshi Guha wrote: Hi, I am trying to build a series of rlm models. I have my data frame and the models will be built using various coulmns of the data frame. Thus a series of models would be m1 - rlm(V1 ~ V2 + V3 + V4, data) m2 - rlm(V1 ~ V2 + V5 + V7, data) m3 - rlm(V1 ~ V2 + V8 + V9, data) I would like to automate this. Is it possible to use a string in place of the formula? I tried doing: fmla - sprintf('V1 ~ V%g + V%g + V%g',2,3,4) m1 -rlm(fmla,data) I get: Error in qr(x) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: NAs introduced by coercion I can understand why this method results in the error but is there any way to get around this? Thanks, --- Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE --- Gods are fragile things; they may be killed by a whiff of science or a dose of common sense. -- Chapman Cohen __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] using a string as the formula in rlm
On Thu, 2003-10-02 at 10:25, Rajarshi Guha wrote: Hi, I am trying to build a series of rlm models. I have my data frame and the models will be built using various coulmns of the data frame. Thus a series of models would be m1 - rlm(V1 ~ V2 + V3 + V4, data) m2 - rlm(V1 ~ V2 + V5 + V7, data) m3 - rlm(V1 ~ V2 + V8 + V9, data) I would like to automate this. Is it possible to use a string in place of the formula? I tried doing: fmla - sprintf('V1 ~ V%g + V%g + V%g',2,3,4) m1 -rlm(fmla,data) I get: Error in qr(x) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: NAs introduced by coercion I can understand why this method results in the error but is there any way to get around this? See ?as.formula You can then construct an expression and use something like: m1 - rlm(as.formula(expression), data) HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] EMACS/ESS problems
Hello all, since we're on the topic of R-editors. I am using emacs/ess on a unix workstation (to interact with R and have been having a little problem. I usually write the R commands I need to run in a separate buffer then copy and paste them into the *R* buffer for evaluation. The problem is, if any command is spread over multiple lines emacs/R hangs when I paste it in the R buffer for evaluation. if I use a debugger to see what's going on in both programs they're usually waiting on a select statement (input/output). Anybody has had to deal with a similar situation. any advice for a workaround? both emacs/ess are relatively recent versions (installed a few months ago). I tried using ess-eval-buffer/region instead of cutting and pasting and the same thing happens for me. many thanks -- Murad Nayal M.D. Ph.D. Department of Biochemistry and Molecular Biophysics College of Physicians and Surgeons of Columbia University 630 West 168th Street. New York, NY 10032 Tel: 212-305-6884 Fax: 212-305-6926 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] R] Re: Mandelbrot set and C code --
Wizards... With regards to Mario's Mandelbrot.c programming -- would some kind wizard show how to compile and run his code on a Win installation. I'm looking for a simple cookbook example in the same manner that Mario show for Linux. I have Win2000 on this machine. REX --- Original Message - Date: Wed, 01 Oct 2003 14:09:36 +0100 From: [EMAIL PROTECTED] Subject: [R] Re: Mandelbrot set and C code To: Martin Maechler [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii -- Snip -- To anyone interested in trying out these functions, just save the C code into a file, say 'mandelbrot.c', to be able to use the C code with R a shared object needs to be created. This is done simple running the following command from the directory where 'mandelbrot.c' is stored (note this code was tried in Linux, for Win users I think the instructions are similar but you need you check it out): R CMD SHLIB mandelbrot.c This will create the file 'mandelbrot.so' in that same directory. Start R from this directory and paste the above R code into the console. Type dyn.load(mandelbrot.so) --snip-- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] EMACS/ESS problems
Hi, A.J. Rossini wrote: 1. I've never seen this behavior, ever. Do you get the same with C-c C-r (highlight region, then C-c C-r sends to the R process in Emacs). Or, if you use C-c C-n to step through the lines? maybe my environment is not set up correctly. C-c C-r doesn't do anything: highlight: (either in a text buffer or *ESS*) v = c(1, 2, 3) C-c C-r switch to *R* v Error: Object v not found OR ess-eval-region prints in the one line buffer at the bottom: Starting evalutions... and hangs (I have to stop it with C-g) now if v was defined on one line v=c(1,2,3) ess-eval-region returns with Finished evaluation. but the v vector is still not defined in R I am sure I am doing something silly. just can't figure out what? 2. [EMAIL PROTECTED] might be a better place to send this. thanks for the advice. I'll try that too. Murad Nayal [EMAIL PROTECTED] writes: Hello all, since we're on the topic of R-editors. I am using emacs/ess on a unix workstation (to interact with R and have been having a little problem. I usually write the R commands I need to run in a separate buffer then copy and paste them into the *R* buffer for evaluation. The problem is, if any command is spread over multiple lines emacs/R hangs when I paste it in the R buffer for evaluation. if I use a debugger to see what's going on in both programs they're usually waiting on a select statement (input/output). Anybody has had to deal with a similar situation. any advice for a workaround? both emacs/ess are relatively recent versions (installed a few months ago). I tried using ess-eval-buffer/region instead of cutting and pasting and the same thing happens for me. many thanks -- Murad Nayal M.D. Ph.D. Department of Biochemistry and Molecular Biophysics College of Physicians and Surgeons of Columbia University 630 West 168th Street. New York, NY 10032 Tel: 212-305-6884 Fax: 212-305-6926 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- [EMAIL PROTECTED]http://www.analytics.washington.edu/ Biomedical and Health Informatics University of Washington Biostatistics, SCHARP/HVTN Fred Hutchinson Cancer Research Center UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable FHCRC (M/W): 206-667-7025 FAX=206-667-4812 | use Email __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] lme vs. aov with Error term
Hi, I have a question about using lme and aov for the following dataset. If I understand correctly, using aov with an Error term in the formula is equivalent to using lme with default settings, i.e. both assume compound symmetry correlation structure. And I have found that equivalency in the past. However, with the follwing dataset, I got different answers with using lme and using aov, can anyone explain what happened here? I have 2 differnt response variables x and y in the following dataset, they are actually slightly different (only 3 values of them are different). With y, I achieved the equivalency between lme and aov; but with x, I got different p values for the ANOVA table. --- x-c(-0.0649,-0.0923,-0.0623,0.1809,0.0719,0.1017,0.0144,-0.1727,-0.1332,0.0986,0.304,-0.4093,0.2054,0.251,-0.1062,0.3833,0.0649,0.2908,0.1073,0.0919,0.1167,0.2369,0.306,0.1379) y-c(-0.0649,-0.0923,0.32,0.08,0.0719,0.1017,0.05,-0.1727,-0.1332,0.15,0.304,-0.4093,0.2054,0.251,-0.1062,0.3833,0.0649,0.2908,0.1073,0.0919,0.1167,0.2369,0.306,0.1379) treat-as.factor(c(1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2)) time-as.factor(c(1,1,1,1,2,2,2,2,3,3,3,3,1,1,1,1,2,2,2,2,3,3,3,3)) sex-as.factor(c('F','F','M','M','F','F','M','M','F','F','M','M','F','F','M','M','F','F','M','M','F','F','M','M')) subject-as.factor(c(rep(1:4,3),rep(5:8,3))) xx-cbind(x=data.frame(x),y=y,treat=treat,time=time,sex=sex,subject=subject) using x as dependable variable xx.lme-lme(x~treat*sex*time,random=~1|subject,xx) xx.aov-aov(x~treat*sex*time+Error(subject),xx) summary(xx.aov) Error: subject Df Sum Sq Mean Sq F value Pr(F) treat 1 0.210769 0.210769 6.8933 0.05846 . sex1 0.005775 0.005775 0.1889 0.68627 treat:sex 1 0.000587 0.000587 0.0192 0.89649 Residuals 4 0.122304 0.030576 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Error: Within Df Sum Sq Mean Sq F value Pr(F) time2 0.00102 0.00051 0.0109 0.9891 treat:time 2 0.00998 0.00499 0.1066 0.9002 sex:time2 0.02525 0.01263 0.2696 0.7704 treat:sex:time 2 0.03239 0.01619 0.3458 0.7178 Residuals 8 0.37469 0.04684 anova(xx.lme) numDF denDF F-value p-value (Intercept)1 8 3.719117 0.0899 treat 1 4 5.089022 0.0871 sex1 4 0.139445 0.7278 time 2 8 0.012365 0.9877 treat:sex 1 4 0.014175 0.9110 treat:time 2 8 0.120538 0.8880 sex:time 2 8 0.304878 0.7454 treat:sex:time 2 8 0.391012 0.6886 using y as dependable variable xx.lme2-lme(y~treat*sex*time,random=~1|subject,xx) xx.aov2-aov(y~treat*sex*time+Error(subject),xx) summary(xx.aov2) Error: subject Df Sum Sq Mean Sq F value Pr(F) treat 1 0.147376 0.147376 2.0665 0.2239 sex1 0.000474 0.000474 0.0067 0.9389 treat:sex 1 0.006154 0.006154 0.0863 0.7836 Residuals 4 0.285268 0.071317 Error: Within Df Sum Sq Mean Sq F value Pr(F) time2 0.009140 0.004570 0.1579 0.8565 treat:time 2 0.012598 0.006299 0.2177 0.8090 sex:time2 0.043132 0.021566 0.7453 0.5049 treat:sex:time 2 0.069733 0.034866 1.2050 0.3488 Residuals 8 0.231480 0.028935 anova(xx.lme2) numDF denDF F-value p-value (Intercept)1 8 3.0667809 0.1180 treat 1 4 2.0664919 0.2239 sex1 4 0.0066516 0.9389 time 2 8 0.1579473 0.8565 treat:sex 1 4 0.0862850 0.7836 treat:time 2 8 0.2177028 0.8090 sex:time 2 8 0.7453185 0.5049 treat:sex:time 2 8 1.2049883 0.3488 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] EMACS/ESS problems
1. I've never seen this behavior, ever. Do you get the same with C-c C-r (highlight region, then C-c C-r sends to the R process in Emacs). Or, if you use C-c C-n to step through the lines? 2. [EMAIL PROTECTED] might be a better place to send this. Murad Nayal [EMAIL PROTECTED] writes: Hello all, since we're on the topic of R-editors. I am using emacs/ess on a unix workstation (to interact with R and have been having a little problem. I usually write the R commands I need to run in a separate buffer then copy and paste them into the *R* buffer for evaluation. The problem is, if any command is spread over multiple lines emacs/R hangs when I paste it in the R buffer for evaluation. if I use a debugger to see what's going on in both programs they're usually waiting on a select statement (input/output). Anybody has had to deal with a similar situation. any advice for a workaround? both emacs/ess are relatively recent versions (installed a few months ago). I tried using ess-eval-buffer/region instead of cutting and pasting and the same thing happens for me. many thanks -- Murad Nayal M.D. Ph.D. Department of Biochemistry and Molecular Biophysics College of Physicians and Surgeons of Columbia University 630 West 168th Street. New York, NY 10032 Tel: 212-305-6884 Fax: 212-305-6926 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help -- [EMAIL PROTECTED]http://www.analytics.washington.edu/ Biomedical and Health Informatics University of Washington Biostatistics, SCHARP/HVTN Fred Hutchinson Cancer Research Center UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable FHCRC (M/W): 206-667-7025 FAX=206-667-4812 | use Email CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}} __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] R] Re: Mandelbrot set and C code --
You need to install the tools needed to build packages from source. You can read about it in Q3.1 of R for Windows FAQ. Andy -Original Message- From: Rex Bryan Dell1700 [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 12:15 PM To: [EMAIL PROTECTED] Subject: [R] R] Re: Mandelbrot set and C code -- Wizards... With regards to Mario's Mandelbrot.c programming -- would some kind wizard show how to compile and run his code on a Win installation. I'm looking for a simple cookbook example in the same manner that Mario show for Linux. I have Win2000 on this machine. REX --- Original Message - Date: Wed, 01 Oct 2003 14:09:36 +0100 From: [EMAIL PROTECTED] Subject: [R] Re: Mandelbrot set and C code To: Martin Maechler [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii -- Snip -- To anyone interested in trying out these functions, just save the C code into a file, say 'mandelbrot.c', to be able to use the C code with R a shared object needs to be created. This is done simple running the following command from the directory where 'mandelbrot.c' is stored (note this code was tried in Linux, for Win users I think the instructions are similar but you need you check it out): R CMD SHLIB mandelbrot.c This will create the file 'mandelbrot.so' in that same directory. Start R from this directory and paste the above R code into the console. Type dyn.load(mandelbrot.so) --snip-- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo /r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] EMACS/ESS problems
Try eval-linestep C-c C-n in ESS (no cut and paste), and omit the semi-colon at the end of the statement. In a message dated 10/2/03 11:12:37 AM Pacific Daylight Time, [EMAIL PROTECTED] writes: Hi, It didn't help in this case in *scratch* v = c(1, # 2, # 3); highlight then ess-eval-region (hangs) C-g then switch to *R* you see: v = c(1, # + 2, # + I had to type ')' to stop the continuation Also per Sundar's suggestion .Options$continue [1] + I am hoping some of this might give someone a clue as to what's going on! [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] indexing a vector
Dear All: I'd like to know how to sort and then index a vector of floats by several levels in R. For example x-rnorm(100) MyLevels-quantile(x,probs=c(0,.5,1)) MyLevels 0% 50%100% -2.11978442 -0.03770613 2.00186397 next i want to replace each x[i] in x by 1,2,3 or 4 depending on which quantile that x[i] falls. How do I do that in a vector fashion? I tried something like factor(x,levels=as.numeric(MyLevels)) but that doesnt work. Thank you very much, Vlad __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] RE: [S] lme vs. aov with Error term
Hi Bert, Thanks for the suggestions. I tried lme with different control parameters, and also tried using ML, instaed of REML, but still got the same answers. Yes, I hope some gurus on this list could give me some hints. Thanks --- Gunter, Bert [EMAIL PROTECTED] wrote: But they are close. This is almost certainly a numeric issue -- if you set your control parameters in lme so that you run it longer (make the stopping criteria tighter), I'll bet you converge to the same results. ... or it might be some some similar abstruse problem in aov. Interesting, though. I'll be interested in hearing what the gurus have to say (of which I am NOT one) Cheers, Bert Gunter Biometrics Research RY 33-300 Merck Company P.O. Box 2000 Rahway, NJ 07065-0900 Phone: (732) 594-7765 mailto: [EMAIL PROTECTED] The business of the statistician is to catalyze the scientific learning process. -- George E.P. Box -Original Message- From: array chip [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 12:42 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [S] lme vs. aov with Error term Hi, I have a question about using lme and aov for the following dataset. If I understand correctly, using aov with an Error term in the formula is equivalent to using lme with default settings, i.e. both assume compound symmetry correlation structure. And I have found that equivalency in the past. However, with the follwing dataset, I got different answers with using lme and using aov, can anyone explain what happened here? I have 2 differnt response variables x and y in the following dataset, they are actually slightly different (only 3 values of them are different). With y, I achieved the equivalency between lme and aov; but with x, I got different p values for the ANOVA table. --- x-c(-0.0649,-0.0923,-0.0623,0.1809,0.0719,0.1017,0.0144,-0.1727,-0.1332,0.0 986,0.304,-0.4093,0.2054,0.251,-0.1062,0.3833,0.0649,0.2908,0.1073,0.0919,0. 1167,0.2369,0.306,0.1379) y-c(-0.0649,-0.0923,0.32,0.08,0.0719,0.1017,0.05,-0.1727,-0.1332,0.15,0.304 ,-0.4093,0.2054,0.251,-0.1062,0.3833,0.0649,0.2908,0.1073,0.0919,0.1167,0.23 69,0.306,0.1379) treat-as.factor(c(1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2)) time-as.factor(c(1,1,1,1,2,2,2,2,3,3,3,3,1,1,1,1,2,2,2,2,3,3,3,3)) sex-as.factor(c('F','F','M','M','F','F','M','M','F','F','M','M','F','F','M' ,'M','F','F','M','M','F','F','M','M')) subject-as.factor(c(rep(1:4,3),rep(5:8,3))) xx-cbind(x=data.frame(x),y=y,treat=treat,time=time,sex=sex,subject=subject) using x as dependable variable xx.lme-lme(x~treat*sex*time,random=~1|subject,xx) xx.aov-aov(x~treat*sex*time+Error(subject),xx) summary(xx.aov) Error: subject Df Sum Sq Mean Sq F value Pr(F) treat 1 0.210769 0.210769 6.8933 0.05846 . sex1 0.005775 0.005775 0.1889 0.68627 treat:sex 1 0.000587 0.000587 0.0192 0.89649 Residuals 4 0.122304 0.030576 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Error: Within Df Sum Sq Mean Sq F value Pr(F) time2 0.00102 0.00051 0.0109 0.9891 treat:time 2 0.00998 0.00499 0.1066 0.9002 sex:time2 0.02525 0.01263 0.2696 0.7704 treat:sex:time 2 0.03239 0.01619 0.3458 0.7178 Residuals 8 0.37469 0.04684 anova(xx.lme) numDF denDF F-value p-value (Intercept)1 8 3.719117 0.0899 treat 1 4 5.089022 0.0871 sex1 4 0.139445 0.7278 time 2 8 0.012365 0.9877 treat:sex 1 4 0.014175 0.9110 treat:time 2 8 0.120538 0.8880 sex:time 2 8 0.304878 0.7454 treat:sex:time 2 8 0.391012 0.6886 using y as dependable variable xx.lme2-lme(y~treat*sex*time,random=~1|subject,xx) xx.aov2-aov(y~treat*sex*time+Error(subject),xx) summary(xx.aov2) Error: subject Df Sum Sq Mean Sq F value Pr(F) treat 1 0.147376 0.147376 2.0665 0.2239 sex1 0.000474 0.000474 0.0067 0.9389 treat:sex 1 0.006154 0.006154 0.0863 0.7836 Residuals 4 0.285268 0.071317 Error: Within Df Sum Sq Mean Sq F value Pr(F) time2 0.009140 0.004570 0.1579 0.8565 treat:time 2 0.012598 0.006299 0.2177 0.8090 sex:time2 0.043132 0.021566 0.7453 0.5049 treat:sex:time 2 0.069733 0.034866 1.2050 0.3488 Residuals 8 0.231480 0.028935 anova(xx.lme2) numDF denDF F-value p-value (Intercept)1 8 3.0667809 0.1180 treat 1 4 2.0664919 0.2239 sex1 4 0.0066516 0.9389 time 2 8 0.1579473 0.8565 treat:sex 1 4 0.0862850 0.7836 treat:time 2 8 0.2177028 0.8090 sex:time 2 8 0.7453185 0.5049 treat:sex:time 2 8
Re: [R] indexing a vector
morozov wrote: Dear All: I'd like to know how to sort and then index a vector of floats by several levels in R. For example x-rnorm(100) MyLevels-quantile(x,probs=c(0,.5,1)) MyLevels 0% 50%100% -2.11978442 -0.03770613 2.00186397 next i want to replace each x[i] in x by 1,2,3 or 4 depending on which quantile that x[i] falls. How do I do that in a vector fashion? I think rank() is the function you're looking for. Cheers Jason -- Indigo Industrial Controls Ltd. http://www.indigoindustrial.co.nz 64-21-343-545 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] combination levels
Is there a function in R that will give all combination levels. For example, I see there is a choose function that gives choose(5,2) 10 but I want 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 This is a simple example. Actually I would like to do something like 10 choose 4. Paul __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] (no subject)
On 30 Sep 2003, Arunkumar Arumugam wrote: I tried testing some of the programs and functions. I read in the manual that plot(x,y) functions automatically generates a graphical window and plot. that does not happens in my installation. Ummm...can you be a bit more precise? What exactly has happened when you typed plot(x, y)? Have you created two vectors called x and y? Were they any error messages, if so what are the messages? -- Cheers, Kevin -- On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question. -- Charles Babbage (1791-1871) From Computer Stupidities: http://rinkworks.com/stupid/ -- Ko-Kang Kevin Wang Master of Science (MSc) Student SLC Tutor and Lab Demonstrator Department of Statistics University of Auckland New Zealand Homepage: http://www.stat.auckland.ac.nz/~kwan022 Ph: 373-7599 x88475 (City) x88480 (Tamaki) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] indexing a vector
morozov wrote: x-rnorm(100) MyLevels-quantile(x,probs=c(0,.5,1)) MyLevels 0% 50%100% -2.11978442 -0.03770613 2.00186397 next i want to replace each x[i] in x by 1,2,3 or 4 depending on which quantile that x[i] falls. How do I do that in a vector fashion? Take a look at the cut function. -- Ross Ihaka Email: [EMAIL PROTECTED] Department of Statistics Phone: (64-9) 373-7599 x 85054 University of Auckland Fax:(64-9) 373-7018 Private Bag 92019, Auckland New Zealand __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] indexing a vector
On Thu, 2003-10-02 at 12:40, morozov wrote: Dear All: I'd like to know how to sort and then index a vector of floats by several levels in R. For example x-rnorm(100) MyLevels-quantile(x,probs=c(0,.5,1)) MyLevels 0% 50%100% -2.11978442 -0.03770613 2.00186397 next i want to replace each x[i] in x by 1,2,3 or 4 depending on which quantile that x[i] falls. How do I do that in a vector fashion? I tried something like factor(x,levels=as.numeric(MyLevels)) but that doesnt work. Thank you very much, Vlad You might want to look at ?cut, which returns a factor based upon defining breakpoints in a continuous vector. You can break the vector 'x' and relabel the levels to give you what you need. For example: x - rnorm(100) MyLevels - factor(cut(x, quantile(x), include.lowest = TRUE), labels = 1:4) table(MyLevels) MyLevels 1 2 3 4 25 25 25 25 HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Re: [S] lme vs. aov with Error term
Jose, Thank you very much for the explanation! what about if I specify using ML instead of REML in the lme? I found that I still got different answers even I use ML in the lme call. And in any case, should I trust lme more than aov, or vice versa? Thanks again --- [EMAIL PROTECTED] wrote: I have a question about using lme and aov for the following dataset. If I understand correctly, using aov with an Error term in the formula is equivalent to using lme with default settings, i.e. both assume compound symmetry correlation structure. Not necessarily, only when the maximum of the REML objective function falls within the parameter space. This obscure observation translates, in your case, into saying that, when the Subject mean square error is larger than the Within MSE (in the aov notation), then the two fits should coincide. This is the case for your y response: Error: subject Df Sum Sq Mean Sq F value Pr(F) . . . Residuals 4 0.285268 0.071317 Error: Within Df Sum Sq Mean Sq F value Pr(F) . . . Residuals 8 0.231480 0.028935 However, when the Subject MSE is smaller than the Within MSE, the maximum of the REML objective occurs at a negative value of the between-subject variance. Because the lme algorithm forces the estimated parameters to remain within the parameter space, the solution you got probably corresponds to a boundary of the parameter space (the Subject Std. Dev must be fairly small). This is what happens for your x response. Error: subject Df Sum Sq Mean Sq F value Pr(F) . . . Residuals 4 0.122304 0.030576 --- Error: Within Df Sum Sq Mean Sq F value Pr(F) . . . Residuals 8 0.37469 0.04684 Hope this helps. Best, --José - José Pinheiro Biostatistics, Novartis Pharmaceuticals One Health Plaza, Room 419/2115, East Hanover, NJ 07936 - __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] combination levels
On Thu, 2003-10-02 at 13:40, Paul Green wrote: Is there a function in R that will give all combination levels. For example, I see there is a choose function that gives choose(5,2) 10 but I want 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 This is a simple example. Actually I would like to do something like 10 choose 4. Paul See the combinations() function in the 'gregmisc' package on CRAN: combinations(5, 2) [,1] [,2] [1,]12 [2,]13 [3,]14 [4,]15 [5,]23 [6,]24 [7,]25 [8,]34 [9,]35 [10,]45 HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Search for a text string and write position related data to a file
Dear all, I just started using R today. What I need to do is find a text string in a (large) text file and than copy the some position related lines (or text) to an other text file. Is this possible with R? Example: Search string is: Date write line of search string +0, +2, +6, +7, +8, +9 1 Report of measured data 2 - 3 Date: 01-10-03 4 5 Time: 17:52:23 6 7 == 8 ++ 9 x1=1.5 10 y1=2.9 11 x2=29 12 y2=704 .. .. 552 Date: 01-10-03 553 554 Time: 18:04:11 555 556 == 557 ++ 558 x1=1.1 559 y1=1.9 560 x2=35 561 y2=870 .. .. etc The new text file must contain: Date: 01-10-03 Time: 17:52:23 x1=1.5 y1=2.9 x2=29 y2=704 Date: 01-10-03 Time: 18:04:11 x1=1.1 y1=1.9 x2=35 y2=870 etc Is this possible?? Kind Regards, Gerard [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Search for a text string and write position related data to a file
Karin Gerard Preusting [EMAIL PROTECTED] writes: Dear all, I just started using R today. What I need to do is find a text string in a (large) text file and than copy the some position related lines (or text) to an other text file. Is this possible with R? It's hardly a typical R application, but it can be done using a fairly straightforward while loop. See documentation for readLines, writeLines, and grep. (On Unix-like systems, tools like awk or perl will probably get the job done more quickly). -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] EMACS/ESS problems
It looks like you are not using ESS correctly. ESS is designed to work from a buffer containing a file whose name has the .r extension. Thus, open a file, for example, C-x C-f myfile.r and then start using R. My diagnosis is based on your line highlight: (either in a text buffer or *ESS*) ESS won't work from a text buffer because R code has different requirements from ordinary written paragraphs in English or another natural language. The *ESS* buffer is part of the background mechanism that makes ESS work. It is not intended that a user ever look at the *ESS* buffer. One other issue that your original email suggests. We do not recommend the statement v=c(1,2,3) for assignment. It is much better to use the assignment arrow v - c(1,2,3) (with spaces on both sides of the arrow for legibility). It is true that the = will usually do what you expect, but there are some subtle differences (mostly in argument lists to functions). While I can expand on the reasons, for the moment I just want to suggest that you get into the habit of using the assignment arrow. Rich __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Plot can't forget bad parameters
When I give plot some bad paramaters, it keeps giving me error messages forever after. I think the last time this happened, I even got the error messages for completely unrelated, non-graphical functions. Here's a recent example: plot(it[[31]][,c(1, 3)], type=b, usr=c(0, 20, -20, 5)) Warning messages: 1: parameter usr couldn't be set in high-level plot() function 2: parameter usr couldn't be set in high-level plot() function 3: parameter usr couldn't be set in high-level plot() function 4: parameter usr couldn't be set in high-level plot() function 5: parameter usr couldn't be set in high-level plot() function 6: parameter usr couldn't be set in high-level plot() function plot(it[[31]][,c(1, 3)], type=b, ylim=c(-20, 5)) Warning messages: 1: parameter usr couldn't be set in high-level plot() function 2: parameter usr couldn't be set in high-level plot() function 3: parameter usr couldn't be set in high-level plot() function 4: parameter usr couldn't be set in high-level plot() function 5: parameter usr couldn't be set in high-level plot() function 6 Is this a bug, or have I missed something? R 1.7.1 -- Ross Boylan wk: (415) 502-4031 530 Parnassus Avenue (Library) rm 115-4 [EMAIL PROTECTED] Dept of Epidemiology and Biostatistics fax: (415) 476-9856 University of California, San Francisco San Francisco, CA 94143-0840 hm: (415) 550-1062 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] serializing R objects
Hi, is there any way that an R object (say a list of rlm models) could be serialized to disk to be read in at a later time? --- Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE --- Entropy isn't what it used to be. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Plot can't forget bad parameters
On Thu, 2 Oct 2003, Ross Boylan wrote: When I give plot some bad paramaters, it keeps giving me error messages forever after. I think the last time this happened, I even got the error messages for completely unrelated, non-graphical functions. snip Is this a bug, or have I missed something? R 1.7.1 It's to do with redrawing. When the graphics device is redrawn on the screen (eg if it is covered up and then exposed) the commands that created it are replayed. (in fact, I think they may be replayed twice on some systems). It's not entirely a bug, since the redrawing is necessary: we don't keep a bitmap, and even if we did we'd have to redraw on resize. Suppressing warnings on the redraw would make sense, though. After you do a new plot the warnings should stop resurfacing. -thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] Plot can't forget bad parameters
On Thu, 2003-10-02 at 16:54, [EMAIL PROTECTED] wrote: Try rm(last.warning) -Original Message- From: Ross Boylan [mailto:[EMAIL PROTECTED] Sent: Friday, 3 October 2003 9:10 AM To: r-help Subject: [R] Plot can't forget bad parameters When I give plot some bad paramaters, it keeps giving me error messages forever after. I think the last time this happened, I even got the error messages for completely unrelated, non-graphical functions. Here's a recent example: plot(it[[31]][,c(1, 3)], type=b, usr=c(0, 20, -20, 5)) Warning messages: 1: parameter usr couldn't be set in high-level plot() function 2: parameter usr couldn't be set in high-level plot() function 3: parameter usr couldn't be set in high-level plot() function 4: parameter usr couldn't be set in high-level plot() function 5: parameter usr couldn't be set in high-level plot() function 6: parameter usr couldn't be set in high-level plot() function plot(it[[31]][,c(1, 3)], type=b, ylim=c(-20, 5)) Warning messages: 1: parameter usr couldn't be set in high-level plot() function 2: parameter usr couldn't be set in high-level plot() function 3: parameter usr couldn't be set in high-level plot() function 4: parameter usr couldn't be set in high-level plot() function 5: parameter usr couldn't be set in high-level plot() function 6 Is this a bug, or have I missed something? R 1.7.1 Well, that's very odd. I did the rm(), and it printed out the warnings again. Then I repeated the two commands above--only this time, there were no warnings after the second (i.e., things worked OK). __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] serializing R objects
On Thu, 2003-10-02 at 18:19, Rajarshi Guha wrote: Hi, is there any way that an R object (say a list of rlm models) could be serialized to disk to be read in at a later time? See ?save and ?load HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] EMACS/ESS problems
that was exactly what I was missing, Everything now works as advertised. Thank you all so much for the help. you just turned my already very satisfying experience using R into a even more enjoyable one. all the best Rich Heiberger wrote: It looks like you are not using ESS correctly. ESS is designed to work from a buffer containing a file whose name has the .r extension. Thus, open a file, for example, C-x C-f myfile.r and then start using R. My diagnosis is based on your line highlight: (either in a text buffer or *ESS*) ESS won't work from a text buffer because R code has different requirements from ordinary written paragraphs in English or another natural language. The *ESS* buffer is part of the background mechanism that makes ESS work. It is not intended that a user ever look at the *ESS* buffer. One other issue that your original email suggests. We do not recommend the statement v=c(1,2,3) for assignment. It is much better to use the assignment arrow v - c(1,2,3) (with spaces on both sides of the arrow for legibility). It is true that the = will usually do what you expect, but there are some subtle differences (mostly in argument lists to functions). While I can expand on the reasons, for the moment I just want to suggest that you get into the habit of using the assignment arrow. Rich -- Murad Nayal M.D. Ph.D. Department of Biochemistry and Molecular Biophysics College of Physicians and Surgeons of Columbia University 630 West 168th Street. New York, NY 10032 Tel: 212-305-6884 Fax: 212-305-6926 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help