Re: [R] Need to fit a regression line using orthogonal residuals
Just to pick up Third, the resulting line is not optimal for either predicting y for a new x or x from a new y. It's hard to see why it is ever of much interest. It is not a regression (and hence the subject line was misleading), but it does come up in errors-in-variables problems. Suppose you have two sets of measurements of the same quantity with the same variance of measurement error and you want a line calibrating set 2 to set 1. Then the optimal (in the sense of MLE, for example) line is this one, and it is symmetrical in the two sets. Now those are rather specific assumptions but they do come up in some problems in physics and analytical chemistry, and the result goes back to the 19th century. In the 1980s I implemented a version which allowed for unequal (but known) heteroskedastic error variances which is quite popular in analytical chemistry. The literature is patchy: Fuller's `Measurement Error Models' covers the general area, and I recall this being in Sprent's (1969) book `Models in Regression and Related Topics'. See also the thread starting at http://tolstoy.newcastle.edu.au/R/help/00a/0285.html almost 7 years ago. If that is the thread Jonathon Kopecky refers to (how are we to know?) then he is misquoting me: I said it was the same thing as using the first principal component, not an alternative proposal. On Wed, 31 Jan 2007, [EMAIL PROTECTED] wrote: Jonathon Kopecky asks: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathon Kopecky Sent: Tuesday, 30 January 2007 5:52 AM To: r-help@stat.math.ethz.ch Subject: [R] Need to fit a regression line using orthogonal residuals I'm trying to fit a simple linear regression of just Y ~ X, but both X and Y are noisy. Thus instead of fitting a standard linear model minimizing vertical residuals, I would like to minimize orthogonal/perpendicular residuals. I have tried searching the R-packages, but have not found anything that seems suitable. I'm not sure what these types of residuals are typically called (they seem to have many different names), so that may be my trouble. I do not want to use Principal Components Analysis (as was answered to a previous questioner a few years ago), I just want to minimize the combined noise of my two variables. Is there a way for me to do this in R? [WNV] There's always a way if you are prepared to program it. Your question is a bit like asking Is there a way to do this in Fortran? The most direct way to do it is to define a function that gives you the sum of the perpendicular distances and minimise it using, say, optim(). E.g. ppdis - function(b, x, y) sum((y - b[1] - b[2]*x)^2/(1+b[2]^2)) b0 - lsfit(x, y)$coef # initial value op - optim(b0, ppdis, method = BFGS, x=x, y=y) op # now to check the results plot(x, y, asp = 1) # why 'asp = 1'?? exercise abline(b0, col = red) abline(op$par, col = blue) There are a couple of things about this you should be aware of, though First, this is just a fiddly way of finding the first principal component, so your desire not to use Principal Component Analysis is somewhat thwarted, as it must be. Second, the result is sensitive to scale - if you change the scales of either x or y, e.g. from lbs to kilograms, the answer is different. This also means that unless your measurement units for x and y are comparable it's hard to see how the result can make much sense. A related issue is that you have to take some care when plotting the result or orthogonal distances will not appear to be orthogonal. Third, the resulting line is not optimal for either predicting y for a new x or x from a new y. It's hard to see why it is ever of much interest. Bill Venables. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Mit der Webseite www.stat.math.ethz.ch wirst Du nie viele Besucher bekommen!
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Read multiple text files and combine into single file?
Hi everyone! I have 1000 text files that contain data in a standard format separated by semi colons. However, each file also has single header (first) and footer (final) lines. The text files are all named with a sample number, which do not follow a pattern. I need to delete the header and footer lines and combine all files into a single (or possibly several) large files. Does anyone know how this could be done automatically using R? best regards, Ton __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] any implementations for adaptive modeling of time series?
Hallo, my noisy time series represent a fading signal comprising of long enough parts with a simple trend inside of each such a part. Transition from one part into another is always a non-smooth and very sharp/acute. In other words I have a piecewise polynomial noisy curve asymptotically converging to the biased constant, points between pieces are non-differentiable. I am looking for implementations of models adequate for such a data. Are there any possibilities to adapt the ARIMA or MCMC? Many thanks in advance for any help/URLs __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] How to print the objects in the memory
Hi,all: May be a pointless question a - 1:10 b - matrix(1:8,nrow = 4) c - letters[4:8] …… ls() [1] a b c ls() can print the names of the objects in the memory , but I want to get the result : a [1] 1 2 3 4 5 6 7 8 9 10 b [,1] [,2] [1,]15 [2,]26 [3,]37 [4,]48 c [1] d e f g h …… I try the command print(noquote(ls())) which it can't help Best regards usstata __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] mca-graphics: all elements overlapping in the help-example for multiple correspondence analysis
Dear all, I tried out the example in the help document for mca (the multiple correspondence analysis of the MASS package): farms.mca - mca(farms, abbrev=TRUE) farms.mca plot(farms.mca) But the graphic that I get seems unfeasible to me: I cannot recognize the numbers (printed in black) because they are all overlapping and concealing each other. I don ´t dare using my own data, which consist of several hundred cases - I guess I won ´t see anything. How can I solve this? Thank you for any idea! Michael __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] can't find mailing list commands
Sorry for inconvenience - but since I can't find any hints on this list at stat.ethz.ch, I'll ask here: How do I unsubscribe from this list? Thanks for answering - Richard -- Richard Müller - Am Spring 9 - D-58802 Balve-Eisborn www.oeko-sorpe.de __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to print the objects in the memory
1. ? ls.str() 2. My favourite eval(parse(text= ... )) :) sapply(ls(),FUN=function(x)eval(parse(text=x))) -- View this message in context: http://www.nabble.com/-R--How-to-print-the-objects-in-the-memory-tf3147472.html#a8725398 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] mca-graphics: all elements overlapping in the help-example for multiple correspondence analysis
On Wed, 31 Jan 2007, Michael Reinecke wrote: Dear all, I tried out the example in the help document for mca (the multiple correspondence analysis of the MASS package): farms.mca - mca(farms, abbrev=TRUE) farms.mca plot(farms.mca) But the graphic that I get seems unfeasible to me: I cannot recognize the numbers (printed in black) because they are all overlapping and concealing each other. I don ´t dare using my own data, which consist of several hundred cases - I guess I won ´t see anything. How can I solve this? Thank you for any idea! Some levels do overplot, as they are identical (this is an unusual example). But as you see in the book, not many, and you can adjust pointsize of your device or 'cex' to mitigate the problem. Plotting the rows is optional: see the help page. I would not recommend plotting rows for several hundred cases. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] problem with compilation of R on Solaris 10 in x86
Dear List, we're trying to install R on Solaris10 on a x86 (amd64). During the installation we pass successfully the ./configure but we get an error through the built-in function _isnan which we see existing in /lib When passing the command make we get : gcc -std=gnu99 -I../../src/extra/zlib -I../../src/extra/bzip2 -I../../src/extra/pcre -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -g -O2 -c serialize.c -o serialize.o In file included from ../../src/include/Rinternals.h:921, from ../../src/include/Defn.h:72, from serialize.c:29: ../../src/include/Rinlinedfuns.h: In function `fmin2_int': ../../src/include/Rinlinedfuns.h:602: warning: implicit declaration of function `__builtin_isnan' [... and ...] gcc -std=gnu99 -L/usr/local/lib -o R.bin Rmain.o CConverters.o CommandLineArgs.o Rdynload.o Renviron.o RNG.o apply.o arithmetic.o apse.o array.o attrib.o base.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cov.o cum.o dcf.o datetime.o debug.o deparse.o deriv.o dotcode.o dounzip.o dstruct.o duplicate.o engine.o envir.o errors.o eval.o format.o fourier.o gevents.o gram.o gram-ex.o graphics.o identical.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o model.o names.o objects.o optim.o optimize.o options.o par.o paste.o pcre.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o random.o regex.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o size.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o unique.o util.o version.o vfonts.o xxxpr.o mkdtemp.o ../unix/libun! ix.a ../appl/libappl.a ../nmath/libnmath.a -L../../lib -lRblas -L/opt/sfw/lib/gcc/i386-pc-solaris2.10/3.4.2 -L/usr/ccs/bin -L/opt/sfw/lib -lg2c -lm -lgcc_s ../extra/zlib/libz.a ../extra/bzip2/libbz2.a ../extra/pcre/libpcre.a ../extra/intl/libintl.a -lreadline -lncurses -lnsl -lsocket -ldl -lm Undefined first referenced symbol in file __builtin_isnan arithmetic.o ld: fatal: Symbol referencing errors. No output written to R.bin collect2: ld returned 1 exit status Thank's in advance for all hints how we could overcome this problem, Wolfgang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wolfgang Raffelsberger, PhD Laboratoire de BioInformatique et Génomique Intégrative IGBMC 1 rue Laurent Fries, 67404 Illkirch Strasbourg, France Tel (+33) 388 65 3300 Fax (+33) 388 65 3276 http://www-bio3d-igbmc.u-strasbg.fr/~wraff [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to print the objects in the memory
On Wed, 31 Jan 2007, Vladimir Eremeev wrote: [replying to something else, without any indication or context. That 'something' was about how to print all objects.] 1. ? ls.str() 2. My favourite eval(parse(text= ... )) :) sapply(ls(),FUN=function(x)eval(parse(text=x))) Note library(fortune) fortune(parse) If the answer is parse() you should usually rethink the question. -- Thomas Lumley R-help (February 2005) Here the answer is 'get', as ls.str uses via utils:::print.ls_str. You need to be careful to get the correct object of the given name, and using your favourite will not in general do so. When you have a character string containing the name of a variable, eval(as.name(x)) is more direct than parsing (but less direct that get(x) ). And since there is no reason that the results are all suitable for simplifying to a vector, lapply is safer. E.g. xx - pi y - test it sapply(ls(), function(x) eval(parse(text=x))) xx y 3.14159265358979 test it is not what is wanted. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] can't find mailing list commands
Hmm, I thought that learning to read was pretty wide-spread in your country... Richard == Richard Müller [EMAIL PROTECTED] on Wed, 31 Jan 2007 10:01:34 +0100 writes: Richard Sorry for inconvenience - but since I can't find Richard any hints on this list at stat.ethz.ch, I'll ask here: Richard How do I unsubscribe from this list? Richard __ Richard R-help@stat.math.ethz.ch mailing list Richard https://stat.ethz.ch/mailman/listinfo/r-help why do you think this does *not* mention 'unsubscribe' ??? Richard PLEASE do read the posting guide ... yes, indeed. Spamming 3000 readers of R-help with your problem is rather impolite. I apologize for doing the same with my answer, but maybe it prevents similar questsion at least for the very near future.. Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Check for presence of object in group of objects
Dear List, must be simple, but i got stuck on this... I´ve been trying around for some time, but I could not find a straigthforward way to do this: How can one ask if a certain object is element of a certain group of objects, e.g stored in a vector? x - c(a, b, c) # is there a simple function which returns: is a part of x? TRUE is d part of x? FALSE Thanks a lot Christoph __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Adding Scale to image
Peter Robinson wrote: Dear List, I have used the image() function to show a heat plot of a matrix of data whose intensity is color-coded. I have two questions that I have not been able to solve by using the help system or google. 1) How can one add a scale/legend that shows what numerical values a given color corresponds to? You can use the gradient.rect function in the plotrix package to display a rectangular bar with a specified number of color slices in it. For an example of how to make this into a color legend, see the color2D.matplot function in the same package. If this is of interest to R users, I could include a color.legend function in plotrix that would do it all. Jim __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Check for presence of object in group of objects
Christoph Heibl wrote: Dear List, must be simple, but i got stuck on this... I´ve been trying around for some time, but I could not find a straigthforward way to do this: How can one ask if a certain object is element of a certain group of objects, e.g stored in a vector? x - c(a, b, c) # is there a simple function which returns: is a part of x? TRUE is d part of x? FALSE x - c(a, b, c) a %in% x [1] TRUE d %in% x [1] FALSE ?is.element Thanks a lot Christoph __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Check for presence of object in group of objects
You need %in% a %in% x d %in% x ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 [EMAIL PROTECTED] www.inbo.be Do not put your faith in what statistics say until you have carefully considered what they do not say. ~William W. Watt A statistical analysis, properly conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Christoph Heibl Verzonden: woensdag 31 januari 2007 11:01 Aan: r-help@stat.math.ethz.ch Onderwerp: [R] Check for presence of object in group of objects Dear List, must be simple, but i got stuck on this... I´ve been trying around for some time, but I could not find a straigthforward way to do this: How can one ask if a certain object is element of a certain group of objects, e.g stored in a vector? x - c(a, b, c) # is there a simple function which returns: is a part of x? TRUE is d part of x? FALSE Thanks a lot Christoph __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] readBin is much slower for raw input than for a file
This hasn't generated any feedback after a few days on R-devel, so I'm forwarding it to R-help in case anyone here has any ideas... Thanks, Jon -- Forwarded message -- From: Jon Clayden [EMAIL PROTECTED] Date: 26-Jan-2007 11:25 Subject: readBin is much slower for raw input than for a file To: r-devel@r-project.org Dear all, I'm trying to write an efficient binary file reader for a file type that is made up of several fields of variable length, and so requires many small reads. Doing this on the file directly using a sequence of readBin() calls is a bit too slow for my needs, so I tried buffering the file into a raw vector and reading from that (loc is the equivalent of the file pointer): fileSize - file.info(fileName)$size connection - file(fileName, rb) bytes - readBin(connection, raw, n=fileSize) loc - 0 close(connection) -- # within a custom read function: if (loc == 0) data - readBin(bytes, what, n, size, ...) else if (loc 0) data - readBin(bytes[-(1:loc)], what, n, size, ...) However, this method runs almost 10 times slower for me than the sequence of file reads did. The initial call to readBin() - for reading in the file - is very quick, but running Rprof shows that the vast majority of the run time in doing the full parse is spent in readBin, so it does seem to be that that's slowing things down. Can anyone shed any light on why this is? I'm not expecting miracles here - and I realise that writing the whole read routine in C would be much quicker - but surely reading from a raw vector should work out faster than reading from a file? The system is R-2.4.1/Linux, Xeon 3.2 GHz, 2 GiB RAM; typical file size is 44 KiB. Thanks in advance, Jon __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Adding Scale to image
image.plot from fields plots an image and a legend (or scale) Dr. med. Peter Robinson wrote: I have used the image() function to show a heat plot of a matrix of data whose intensity is color-coded. 1) How can one add a scale/legend that shows what numerical values a given color corresponds to? -- View this message in context: http://www.nabble.com/-R--Adding-Scale-to-image-tf3142258.html#a8727371 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help with function system and MS-DOS command TYPE
Chen, Xiao wrote: Greetings - I have a quick question that I hope someone will have a quick answer. I have tried to use the R function system with the MS-DOS command type to display the full content of a text file. But it always returns with a message saying the text file is not found. I could accomplish the same task with the cat command which is one of the unix-like commands that I have installed on my windows machine. But I would like to know how it would work with the type command. Here is what I have tried: zz-file(d:/work/test/test.txt, w) cat(this is a test\n, file=zz) close(zz) system(cat test.txt, show.output.on.console=T) this is a test system(type test.txt, show.output.on.console=T) test.txt not found type is an internal command, rather than an executable file use system(cmd /c type test.txt, show.output.on.console=T) or system(command /c type test.txt, show.output.on.console=T) -- View this message in context: http://www.nabble.com/-R--help-with-function-%22system%22-and-MS-DOS-command-TYPE-tf3146629.html#a8727428 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Interactive plots with R
Hi, I wrote some simple rpanel package script for visual spectral data comparison. At this example i have a three samples and i want to zoom through x and y axis to compare differences between samples. With my script below I can zoom to some data region and add some other spetra to the plot, through text input field. But I can't figure out, how to change axis scaling for all displayed spectra, because only first spectra are redrawed after axis scaling. Or maybe I need to study samples and documentation for tcltk package? My script: DATAPPM=seq(0,11,0.004) DATAPPM=data.frame(DATAPPM,DATAPPM,DATAPPM) DATAS=data.frame (S1=sample(1:3260,2751),S2=sample(1:3260,2751),S3=sample(1:3260,2751)) library (rpanel) pplotNMR - function (panel) { with (panel,{ VECP - DATAPPM[,sample] VECS - DATAS[,sample] names (VECP) - rownames(DATAPPM) names (VECS) - rownames(DATAS) SEL - names(VECP[VECPMIN VECPMAX]) VECP - VECP[SEL] VECS - VECS[SEL] plot (VECP,VECS,type=l,xlim=c(MAX,MIN),xlab=PPM,ylab=intensity, ylim=c(YMIN,YMAX)) panel}) } pplotNMRadd- function (panel) { with (panel, { sample - as.numeric (sample.text) VECP - DATAPPM[,sample] VECS - DATAS[,sample] names (VECP) - rownames(DATAPPM) names (VECS) - rownames(DATAS) SEL - names(VECP[VECPMIN VECPMAX]) VECP - VECP[SEL] VECS - VECS[SEL] points (VECP,VECS,type=l,col=sample) panel }) } panel - rp.control (title=NMR control,MIN=-2,MAX=12,sample=1,YMAX=max(apply(DATAS,2,max)),YMIN=min(apply(DATAS,2,min)),sample.text=1) rp.slider(panel,MIN,from=-2,to=12,showvalue=TRUE,action=pplotNMR,title=ppm min) rp.slider(panel,MAX,from=-2,to=12,showvalue=TRUE,action=pplotNMR,title=ppm max) rp.slider(panel,YMAX,from=YMIN,to=max(apply(DATAS,2,max)),showvalue=TRUE,action=pplotNMR,title=Intesity) rp.doublebutton (panel,YMAX,step=10,action=pplotNMR,title=intensity, step=10,showvalue=TRUE) rp.textentry (panel, sample.text, action=pplotNMRadd, title=Add sample to plot:) Thanks and regards, Andris Jankevics __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] how to join two arrays using their column names intersection
Here is a workable solution: df1 - data.frame(ar1) df2 - data.frame(ar2) cmn - intersect(names(df1),names(df2)) rbind(df1[,cmn],df2[,cmn]) Best Bendix __ Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2-4 DK-2820 Gentofte Denmark +45 44 43 87 38 (direct) +45 30 75 87 38 (mobile) +45 44 43 73 13 (fax) [EMAIL PROTECTED] http://www.biostat.ku.dk/~bxc __ -Original Message- From: Federico Abascal [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 30, 2007 12:28 PM To: r-help@stat.math.ethz.ch Subject: [R] how to join two arrays using their column names intersection Dear all, I have a problem that may be someone of you can help. I am a newbie and do not find how to do it in manuals. I have two arrays, for example: ar1 - array(data=c(1:16),dim=c(4,4)) ar2 - array(data=c(1:16),dim=c(4,4)) colnames(ar1)-c(A,B,D,E) colnames(ar2)-c(C,A,E,B) ar1 A B D E [1,] 1 5 9 13 [2,] 2 6 10 14 [3,] 3 7 11 15 [4,] 4 8 12 16 ar2 C A E B [1,] 1 5 9 13 [2,] 2 6 10 14 [3,] 3 7 11 15 [4,] 4 8 12 16 I would like to join both arrays only for the columns present in both ar1 and ar2 (the intersection). I would like to obtain this: A B E [1,] 1 5 13 [2,] 2 6 14 [3,] 3 7 15 [4,] 4 8 16 [5,] 5 13 9 [6,] 6 14 10 [7,] 7 15 11 [8,] 8 16 12 (rows 5-8 correspond to ar2) I have tried several things but I am unable to accomplish it. Any experienced user could give me some advice, please? I have another question: how can I sort the columns of an array according to its column names (for ar2, change CAEB to ABCE)? Thanks in advance! Federico __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] problem with compilation of R on Solaris 10 in x86
This has come up several times, all with long obselete versions of gcc. R does not use __builtin_isnan, but gcc does in its own (rather than Solaris') header files. So it is an issue with the compiler, and note that 3.4.2 is an old (Sept 2004) version of the compiler. If you are happy to use SunFreeware, they offer a pre-built R (apart for some unstated reason for the foreign package) at http://www.sunfreeware.com/programlistintel10.html#R and so it would appear that others have succeeded with more recent compilers. On Wed, 31 Jan 2007, Wolfgang Raffelsberger wrote: Dear List, we're trying to install R on Solaris10 on a x86 (amd64). During the installation we pass successfully the ./configure but we get an error through the built-in function _isnan which we see existing in /lib When passing the command make we get : gcc -std=gnu99 -I../../src/extra/zlib -I../../src/extra/bzip2 -I../../src/extra/pcre -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -g -O2 -c serialize.c -o serialize.o In file included from ../../src/include/Rinternals.h:921, from ../../src/include/Defn.h:72, from serialize.c:29: ../../src/include/Rinlinedfuns.h: In function `fmin2_int': ../../src/include/Rinlinedfuns.h:602: warning: implicit declaration of function `__builtin_isnan' [... and ...] gcc -std=gnu99 -L/usr/local/lib -o R.bin Rmain.o CConverters.o CommandLineArgs.o Rdynload.o Renviron.o RNG.o apply.o arithmetic.o apse.o array.o attrib.o base.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cov.o cum.o dcf.o datetime.o debug.o deparse.o deriv.o dotcode.o dounzip.o dstruct.o duplicate.o engine.o envir.o errors.o eval.o format.o fourier.o gevents.o gram.o gram-ex.o graphics.o identical.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o model.o names.o objects.o optim.o optimize.o options.o par.o paste.o pcre.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o random.o regex.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o size.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o unique.o util.o version.o vfonts.o xxxpr.o mkdtemp.o ../unix/libun! ix.a ../appl/libappl.a ../nmath/libnmath.a -L../../lib -lRblas -L/opt/sfw/lib/gcc/i386-pc-solaris2.10/3.4.2 -L/usr/ccs/bin -L/opt/sfw/lib -lg2c -lm -lgcc_s ../extra/zlib/libz.a ../extra/bzip2/libbz2.a ../extra/pcre/libpcre.a ../extra/intl/libintl.a -lreadline -lncurses -lnsl -lsocket -ldl -lm Undefined first referenced symbol in file __builtin_isnan arithmetic.o ld: fatal: Symbol referencing errors. No output written to R.bin collect2: ld returned 1 exit status Thank's in advance for all hints how we could overcome this problem, Wolfgang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wolfgang Raffelsberger, PhD Laboratoire de BioInformatique et Génomique Intégrative IGBMC 1 rue Laurent Fries, 67404 Illkirch Strasbourg, France Tel (+33) 388 65 3300 Fax (+33) 388 65 3276 http://www-bio3d-igbmc.u-strasbg.fr/~wraff [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Looking for a faster code
Hi, I have two matrices A (m x 2) and B (n x 2), where m and n are large integers (on the order of 10^4). I am looking for an efficient way to create another matrix, W (m x n), which can be defined as follows: for (i in 1:m){ for (j in 1:n) { W[i,j] - g(A[i,], B[j,]) } } I have tried the following and it works okay, but I am sure that I can do even better: for (i in 1:m) { W[i,] - apply(B, 1, y=A[i,], function(x,y) g(y,x)) } How can I do this in a faster manner (for example, I feel that I should be able to use outer)? Thanks for any suggestions. Best, Ravi. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help with function system and MS-DOS command TYPE
Try 'file.show' On 1/30/07, Chen, Xiao [EMAIL PROTECTED] wrote: Greetings - I have a quick question that I hope someone will have a quick answer. I have tried to use the R function system with the MS-DOS command type to display the full content of a text file. But it always returns with a message saying the text file is not found. I could accomplish the same task with the cat command which is one of the unix-like commands that I have installed on my windows machine. But I would like to know how it would work with the type command. Here is what I have tried: zz-file(d:/work/test/test.txt, w) cat(this is a test\n, file=zz) close(zz) system(cat test.txt, show.output.on.console=T) this is a test system(type test.txt, show.output.on.console=T) test.txt not found Thanks much for any help that you could offer. Best, Xiao Chen Statistical Consulting Group UCLA Academic Technology Services http://www.ats.ucla.edu/stat/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Fwd: Re: Simple Date problems with cbind
--- John Kane [EMAIL PROTECTED] wrote: Date: Wed, 31 Jan 2007 08:32:03 -0500 (EST) From: John Kane [EMAIL PROTECTED] Subject: Re: [R] Simple Date problems with cbind To: [EMAIL PROTECTED] My thanks to Marc, Tony Plate, Phil Spector Mark Leeds. I totally missed the significance of the Y not y issue even after reading ?strftime. Just after posting I realised why my date was getting coerced to a numeric. Thanks for the various alternatives for creating the data.frame that gets around this. john --- Marc Schwartz [EMAIL PROTECTED] wrote: On Tue, 2007-01-30 at 15:27 -0500, John Kane wrote: I am clearly misunderstanding something about dates and my reading of the help and RSiteSearch have not turned up anything. I have a variable of class Date and I want to add include it in a data.frame. However when do a cbind the date var is coerced into a numeric. However when I tried to create a example I also seem to be doing something wrong as I cannot seem even to create a date class var even when I try to copy an example from the Help Example from Help dates - c(02/27/92, 02/27/92, 01/14/92, 02/28/92, 02/01/92) max -as.Date(dates, %m/%d/%y) max class(max) Results dates - c(02/27/92, 02/27/92, 01/14/92, 02/28/92, 02/01/92) max -as.Date(dates, %m/%d/%y) max [1] 1992-02-27 1992-02-27 1992-01-14 1992-02-28 1992-02-01 class(max) [1] Date My example cc - c(2005/01/24 ,2006/01/23 ,2006/01/23, 2006/01/23) xx - as.Date(cc, %y/%m/%d) xx class(xx) You need to use a capital Y for a four digit year... See ?strftime for more information on date formats. Results cc - c(2005/01/24 ,2006/01/23 ,2006/01/23, 2006/01/23) xx - as.Date(cc, %y/%m/%d) xx [1] NA NA NA NA class(xx) [1] Date cc - c(2005/01/24 ,2006/01/23 ,2006/01/23, 2006/01/23) xx - as.Date(cc, %Y/%m/%d) xx [1] 2005-01-24 2006-01-23 2006-01-23 2006-01-23 class(xx) [1] Date And on to the cbind problem jj - 1:5 cbind(jj,max) jj max [1,] 1 8092 [2,] 2 8092 [3,] 3 8048 [4,] 4 8093 [5,] 5 8066 I have tried various as.Date etc approcaes It is probably something blindingly simple but can anyone suggest something? Thanks In this case, you are trying to cbind() a numeric vector and a Date vector into a matrix. Since a matrix may only have one data type, the Date vector will be coerced to numeric. If you want mixed data types, you need to create a data frame: jj - 1:4 DF - data.frame(jj, xx) DF jj xx 1 1 2005-01-24 2 2 2006-01-23 3 3 2006-01-23 4 4 2006-01-23 str(DF) 'data.frame': 4 obs. of 2 variables: $ jj: int 1 2 3 4 $ xx:Class 'Date' num [1:4] 12807 13171 13171 13171 Alternatively, create an initial data frame with 'jj' and then cbind() 'xx': JJ - data.frame(jj) str(JJ) 'data.frame': 4 obs. of 1 variable: $ jj: int 1 2 3 4 DF - cbind(JJ, xx) str(DF) 'data.frame': 4 obs. of 2 variables: $ jj: int 1 2 3 4 $ xx:Class 'Date' num [1:4] 12807 13171 13171 13171 Once you create the initial data frame, cbind() will then use the appropriate approach based upon the first argument already being a data frame. HTH, Marc Schwartz __ Do You Yahoo!? protection around http://mail.yahoo.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Read multiple text files and combine into single file?
I think something like this should work: outFile - file(output.txt, w) for (i in ListOfFileNames){ x - readLines(i) writeLines(x[2:(length(x)-1)], outFile) } close(outFile) On 1/30/07, pif pif [EMAIL PROTECTED] wrote: Hi everyone! I have 1000 text files that contain data in a standard format separated by semi colons. However, each file also has single header (first) and footer (final) lines. The text files are all named with a sample number, which do not follow a pattern. I need to delete the header and footer lines and combine all files into a single (or possibly several) large files. Does anyone know how this could be done automatically using R? best regards, Ton __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] [R-pkgs] ROCR 1.0-2
Dear useRs, an update of the ROCR package is available on CRAN. ROCR helps in evaluating the performance of scoring classifiers using ROC graphs, precision/recall plots, lift charts and many other performance metrics. For further information check http://rocr.bioinf.mpi-sb.mpg.de and http://bioinformatics.oxfordjournals.org/cgi/reprint/21/20/3940 NEWS: - added an optional parameter 'fpr.stop' to the performance measure 'auc', allowing to calculate the partial area under the ROC curve up to the false positive rate given by 'fpr.stop'. - fixed bug in 'prediction' function which caused ROCR to halt in the context of a custom label.ordering (thanks to Roberto Perdisci for pointing out) As usual, any feedback is more than welcome! - Tobias -- Tobias Sing Computational Biology and Applied Algorithmics Max Planck Institute for Informatics Saarbrucken, Germany Phone: +49 681 9325 315 Fax: +49 681 9325 399 http://www.tobiassing.net ___ R-packages mailing list R-packages@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help with function system and MS-DOS command TYPE
On Wed, 31 Jan 2007, Vladimir Eremeev wrote: Chen, Xiao wrote: Greetings - I have a quick question that I hope someone will have a quick answer. I have tried to use the R function system with the MS-DOS command type to display the full content of a text file. But it always returns with a message saying the text file is not found. I could accomplish the same task with the cat command which is one of the unix-like commands that I have installed on my windows machine. But I would like to know how it would work with the type command. Here is what I have tried: zz-file(d:/work/test/test.txt, w) cat(this is a test\n, file=zz) close(zz) system(cat test.txt, show.output.on.console=T) this is a test system(type test.txt, show.output.on.console=T) test.txt not found type is an internal command, rather than an executable file use system(cmd /c type test.txt, show.output.on.console=T) or system(command /c type test.txt, show.output.on.console=T) or use the user-friendly version shell(), as it says on the help page for system() (together with a portable version of the above). Please can people who answer questions do their homework as the posting guide requests, and point to the definitive documentation. The archives of these lists are a public resource, and often searched to pick up pieces of misinformation. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] comparing random forests and classification trees
Amy, et al, I agree with you and the group that comparing test set classification errors between the two methods is the way to go. On interpretation, I find the partial dependence plots from randomForest are useful - especially when talking to clients about what the forest means. See slides 32 to 38 in my recent DMA presentation below for some examples. (When looking at the plots for continuous variables, it's really important to pay attention to the decile rug plot on the x-axis so as to not get distracted by the edges which apply to a small part of the population) I would argue that, except for simple text book examples, a full classification tree is not all that easy to interpret. Sure, anyone can walk through each branch, the over all meaning gets lost in the trees. http://loyaltymatrix.com/JimPorzak_RFwithR_DMAAC_Jan07_webinar.pdf On 1/30/07, Darin A. England [EMAIL PROTECTED] wrote: Amy, I have also had this issue with randomForest, that is, you lose the ability to explain the classifier in a simple way to non-specialists (everyone can understand the single decision tree.) As far as comparing the accuracy of the two, I think that you are correct in comparing them by the actual vs predicted tables. randomForest reports this as the confusion matrix, and it also reports the out-of-bag error, which I think you are referring to. I would not compare the rf out-of-bag error with the rpart relative error (or cross-validated error if you are doing cross validation.) So, for what it's worth I think you are correct. Also, do you know about ctree in the party package? If you want to retain the explanatory power of a single tree and have a nice accurate classifier, I have found ctree to work quite well. HTH, Darin On Mon, Jan 29, 2007 at 11:34:51AM +1100, Amy Koch wrote: Hi, I have done an analysis using 'rpart' to construct a Classification Tree. I am wanting to retain the output in tree form so that it is easily interpretable. However, I am wanting to compare the 'accuracy' of the tree to a Random Forest to estimate how much predictive ability is lost by using one simple tree. My understanding is that the error automatically displayed by the two functions is calculated differently so it is therefore incorrect to use this as a comparison. Instead I have produced a table for both analyses comparing the observed and predicted response. E.g. table(data$dependent,predict(model,type=class)) I am looking for confirmation that (a) it is incorrect to compare the error estimates for the two techniques and (b) that comparing the misclassification rates is an appropriate method for comparing the two techniques. Thanks Amy Amelia Koch University of Tasmania School of Geography and Environmental Studies Private Bag 78 Hobart Tasmania, Australia 7001 Ph: +61 3 6226 7454 [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- HTH, Jim Porzak Loyalty Matrix Inc. San Francisco, CA __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to print the objects in the memory
Hi usstata, I think this will get you what you want: mget(ls(),globalenv()) On 1/31/07, usstata [EMAIL PROTECTED] wrote: Hi,all: May be a pointless question a - 1:10 b - matrix(1:8,nrow = 4) c - letters[4:8] …… ls() [1] a b c ls() can print the names of the objects in the memory , but I want to get the result : a [1] 1 2 3 4 5 6 7 8 9 10 b [,1] [,2] [1,]15 [2,]26 [3,]37 [4,]48 c [1] d e f g h …… I try the command print(noquote(ls())) which it can't help Best regards usstata __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Comparing two data matrices of unequal size using rcor.test
I am using the rcor.test function available in the ltm package and wanted to know if there was a way to use this function to compute the correlation of two datasets that are not of equal length (similar to the base cor function). I was thinking an apply function like by might work but so far I have had no luck getting it to work.I was wondering if anyone could give me some general advice on this. Damion Nero Plant Molecular Biology Lab Department of Biology New York University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Need to fit a regression line using orthogonal residuals
This problem also comes up in financial hedging problems, but usually the 'errors' need not be of comparable size, so Errors in Variables or Total Least Squares might be used. David L. Reiner Rho Trading Securities, LLC Chicago IL 60605 312-362-4963 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Wednesday, January 31, 2007 1:57 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: Re: [R] Need to fit a regression line using orthogonal residuals Just to pick up Third, the resulting line is not optimal for either predicting y for a new x or x from a new y. It's hard to see why it is ever of much interest. It is not a regression (and hence the subject line was misleading), but it does come up in errors-in-variables problems. Suppose you have two sets of measurements of the same quantity with the same variance of measurement error and you want a line calibrating set 2 to set 1. Then the optimal (in the sense of MLE, for example) line is this one, and it is symmetrical in the two sets. Now those are rather specific assumptions but they do come up in some problems in physics and analytical chemistry, and the result goes back to the 19th century. In the 1980s I implemented a version which allowed for unequal (but known) heteroskedastic error variances which is quite popular in analytical chemistry. The literature is patchy: Fuller's `Measurement Error Models' covers the general area, and I recall this being in Sprent's (1969) book `Models in Regression and Related Topics'. See also the thread starting at http://tolstoy.newcastle.edu.au/R/help/00a/0285.html almost 7 years ago. If that is the thread Jonathon Kopecky refers to (how are we to know?) then he is misquoting me: I said it was the same thing as using the first principal component, not an alternative proposal. On Wed, 31 Jan 2007, [EMAIL PROTECTED] wrote: Jonathon Kopecky asks: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathon Kopecky Sent: Tuesday, 30 January 2007 5:52 AM To: r-help@stat.math.ethz.ch Subject: [R] Need to fit a regression line using orthogonal residuals I'm trying to fit a simple linear regression of just Y ~ X, but both X and Y are noisy. Thus instead of fitting a standard linear model minimizing vertical residuals, I would like to minimize orthogonal/perpendicular residuals. I have tried searching the R-packages, but have not found anything that seems suitable. I'm not sure what these types of residuals are typically called (they seem to have many different names), so that may be my trouble. I do not want to use Principal Components Analysis (as was answered to a previous questioner a few years ago), I just want to minimize the combined noise of my two variables. Is there a way for me to do this in R? [WNV] There's always a way if you are prepared to program it. Your question is a bit like asking Is there a way to do this in Fortran? The most direct way to do it is to define a function that gives you the sum of the perpendicular distances and minimise it using, say, optim(). E.g. ppdis - function(b, x, y) sum((y - b[1] - b[2]*x)^2/(1+b[2]^2)) b0 - lsfit(x, y)$coef # initial value op - optim(b0, ppdis, method = BFGS, x=x, y=y) op # now to check the results plot(x, y, asp = 1) # why 'asp = 1'?? exercise abline(b0, col = red) abline(op$par, col = blue) There are a couple of things about this you should be aware of, though First, this is just a fiddly way of finding the first principal component, so your desire not to use Principal Component Analysis is somewhat thwarted, as it must be. Second, the result is sensitive to scale - if you change the scales of either x or y, e.g. from lbs to kilograms, the answer is different. This also means that unless your measurement units for x and y are comparable it's hard to see how the result can make much sense. A related issue is that you have to take some care when plotting the result or orthogonal distances will not appear to be orthogonal. Third, the resulting line is not optimal for either predicting y for a new x or x from a new y. It's hard to see why it is ever of much interest. Bill Venables. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __
[R] Wiki for Graphics tips for MacOS X
Hi Folks, I just finished (the first draft of) a Wiki document to explains options for producing graphics to incorporate in MS Word. Thanks to all those who provided input, and who provided the wiki space. Here is the direct link. http://wiki.r-project.org/rwiki/doku.php?id=tips:using- platform:macosx-graphics Cheers, Hank Dr. Hank Stevens, Assistant Professor 338 Pearson Hall Botany Department Miami University Oxford, OH 45056 Office: (513) 529-4206 Lab: (513) 529-4262 FAX: (513) 529-4243 http://www.cas.muohio.edu/~stevenmh/ http://www.muohio.edu/ecology/ http://www.muohio.edu/botany/ E Pluribus Unum __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] features of save and save.image (unexpected file sizes)
Hi, Today I came upon unexpected R behaviour. I did some modelling and the result was R object, about 28MB size (nested list, with matrixes as list elements). When I was saving the session with save.image, the resulting .RData file was 300MB. There were no other large objects: sum(sapply(ls(),function(x)eval(parse(text=paste(object.size(,x,),sep=/1024^2) [1] 30.10540 The interesting thing, then I removed the large object with rm, save.image again produced .RData file with 300MB size. Only after rm(list=ls()) I got normal sized .RData file. I used dump for dumping my object, the resulting dump file was 72 MB in size. So I assume that R was saving some large object which was not visible to me directly, using ls(). Is there a way to find such objects, and discard them before saving? I use R 2.4.1 on Ubuntu 6.06, through Emacs 23.0 and ESS 5.3.1. Vaidotas Zemlys -- Doctorate student, http://www.mif.vu.lt/katedros/eka/katedra/zemlys.php Vilnius University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Wiki for Graphics tips for MacOS X
To get the best results you need to transfer it using vector graphics rather than bitmapped graphics: http://www.stc-saz.org/resources/0203_graphics.pdf There are a number of variations described here (see entire thread). Its for UNIX and Windows but I think it would likely work similarly on Mac and Windows: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/32297.html On 1/31/07, Martin Henry H. Stevens [EMAIL PROTECTED] wrote: Hi Folks, I just finished (the first draft of) a Wiki document to explains options for producing graphics to incorporate in MS Word. Thanks to all those who provided input, and who provided the wiki space. Here is the direct link. http://wiki.r-project.org/rwiki/doku.php?id=tips:using- platform:macosx-graphics Cheers, Hank Dr. Hank Stevens, Assistant Professor 338 Pearson Hall Botany Department Miami University Oxford, OH 45056 Office: (513) 529-4206 Lab: (513) 529-4262 FAX: (513) 529-4243 http://www.cas.muohio.edu/~stevenmh/ http://www.muohio.edu/ecology/ http://www.muohio.edu/botany/ E Pluribus Unum __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Regression Line Plot
Sir I am not finding the function to plot least square regression line on type=o plot of two variables. guid me in this regard. -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help to solve matrices
Sir I am new user of R. I am facing problems in solving matrices. for example a-array(c(3,4,1),dim=c(3,1)) b-a%o%a b , , 1, 1 [,1] [1,]9 [2,] 12 [3,]3 , , 2, 1 [,1] [1,] 12 [2,] 16 [3,]4 , , 3, 1 [,1] [1,]3 [2,]4 [3,]1 solve(b) Error in solve.default(b) : only square matrices can be inverted solve(b,a) Error in solve.default(b, a) : 'b' must be compatible with 'a' Sir I request you to help me in this regard. AMINA SHAHZAD Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help with function system and MS-DOS command TYPE
Dear R-Help, Thanks much. I have received very good advice from a couple of experts. R-help is just wonderful! I have combined all the solutions that I got and they are shown below: zz-file(d:/work/test/test.txt, w) cat(this is a test\n, file=zz) close(zz) setwd(d:/work/test) shell(type test.txt) system(cat test.txt, show.output.on.console=T) file.show(d:/work/test/test.txt) #opens a new window file.show(d:/work/test/test.txt, pager=console) #displays on console Thanks again for all the help. Best regards, Xiao Chen Statistical Consulting Group UCLA Academic Technology Services http://www.ats.ucla.edu/stat/ -Original Message- From: Chen, Xiao Sent: Tuesday, January 30, 2007 8:23 PM To: 'r-help@stat.math.ethz.ch' Subject: help with function system and MS-DOS command TYPE Greetings - I have a quick question that I hope someone will have a quick answer. I have tried to use the R function system with the MS-DOS command type to display the full content of a text file. But it always returns with a message saying the text file is not found. I could accomplish the same task with the cat command which is one of the unix-like commands that I have installed on my windows machine. But I would like to know how it would work with the type command. Here is what I have tried: zz-file(d:/work/test/test.txt, w) cat(this is a test\n, file=zz) close(zz) system(cat test.txt, show.output.on.console=T) this is a test system(type test.txt, show.output.on.console=T) test.txt not found Thanks much for any help that you could offer. Best, Xiao Chen Statistical Consulting Group UCLA Academic Technology Services http://www.ats.ucla.edu/stat/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Regression Line Plot
On Wed, 2007-01-31 at 09:25 -0800, amna khan wrote: Sir I am not finding the function to plot least square regression line on type=o plot of two variables. guid me in this regard. Did you want something like this: x - 1:50 y - rnorm(50) plot(x, y, type = o) abline(lm(y ~ x)) See ?abline if so. Alternatively, see ?predict.lm for additional possibilities. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R for SAS SPSS Users Document
Hi, I am pleased to announce the availability of the document, R for SAS and SPSS Users, at http://oit.utk.edu/scc/RforSASSPSSusers.doc I've looked at the document and printed it. I think it will be very useful to me, even if I will use it the reverse way : learn how to use SAS from R... As I am far from an R expert, I will not be able to give you good advices on R code. But maybe you would have had more comments on your tutorial if you had given the link to the PDF version instead of the MSWord one : http://oit.utk.edu/scc/RforSASSPSSusers.pdf Thanks again for your document, -- Julien __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] features of save and save.image (unexpected file sizes)
Two comments: 1) ls() does not list all the objects: it has all.names argument. 2) save.image() does not just save the objects in the workspace, it also saves any environments they may have. Having a function with a large environment is the usual cause of a large saved image. (And finally, a compressed binary representation from save.image is nor comparable sizewise with an ASCII version from dump.) Vaidotas Zemlys wrote: Hi, Today I came upon unexpected R behaviour. I did some modelling and the result was R object, about 28MB size (nested list, with matrixes as list elements). When I was saving the session with save.image, the resulting .RData file was 300MB. There were no other large objects: sum(sapply(ls(),function(x)eval(parse(text=paste(object.size(,x,),sep=/1024^2) [1] 30.10540 The interesting thing, then I removed the large object with rm, save.image again produced .RData file with 300MB size. Only after rm(list=ls()) I got normal sized .RData file. I used dump for dumping my object, the resulting dump file was 72 MB in size. So I assume that R was saving some large object which was not visible to me directly, using ls(). Is there a way to find such objects, and discard them before saving? I use R 2.4.1 on Ubuntu 6.06, through Emacs 23.0 and ESS 5.3.1. Vaidotas Zemlys -- Doctorate student, http://www.mif.vu.lt/katedros/eka/katedra/zemlys.php Vilnius University -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] A GSE data in the web of ncbi, GSE3524 cannot be open correctly
Hi, all I met a problem to query GSE3524, which cannot be open on my computer. I hope some of you would be kind to give me some advice. Thanks! The code is as follow: ## library(GEOquery) gsename=GSE3524 gse=getGEO(gsename) ## The error information follows as ÊÔ¿ªURL'ftp://ftp.ncbi.nih.gov/pub/geo/DATA/SOFT/by_series/GSE3524/GSE3524_family.soft.gz' ftp data connection made, file length 3586385 bytes ´ò¿ªÁËURL downloaded 3502Kb File stored at: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\Rtmpturmrb/GSE3524.soft.gz Parsing ^PLATFORM = GPL96 ^SAMPLE = GSM80461 ´íÎóÔÚsubstr(x, start = matches + patlen, stop = 1e+07) : ¶à×Ö½Ú×Ö·û´®²»¶Ô ´ËÍâ: Warning message: ÊäÈëµÄ×Ö·û´®2²»ÊÊÓÃÓÚ´ËÓïÑÔ»·¾³ in: regexpr(pattern, text, extended, fixed, useBytes) gsm.temp2-getGEO(gsmname[2]) Junjie Li Tsinghua University [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] bootstrap syntax + bootstrap for teaching
Previous subject: bootstrap bca confidence intervals for large number of statistics in one model; library(boot) Jacob Wegelin asked for an easier way to do many bootstrap confidence intervals for regression output. The syntax would be easier with S+Resample, example below. You create an ordinary lm object, then do e.g. boot - bootstrap(fit, c(coef(fit), predict(fit, newdata=NEWDATA))) limits.bca(boot) RESAMPLING FOR TEACHING I would encourage people to consider using S+Resample for teaching. There is a free student version of S+, and S+Resample is easier for students -- easier syntax (in general, not just this example), plus a menu interface. There are free chapters and packages you can use to supplement a statistics course with resampling. See: http://www.insightful.com/Hesterberg/bootstrap/#Reference.introStat I'll give a workshop on resampling for teaching at the USCOTS conference (U.S. Conference On Teaching Statistics) on May 16. http://www.causeweb.org/uscots http://www.causeweb.org/workshop/hesterberg/ set.seed(0) x - runif(150) y - 2/3 + pi * x^2 + runif(length(x))/2 plot(x,y) DAT - data.frame(x,y) NEWDATA - data.frame(x=seq(min(x), max(x), length=50)) library(resample) fit - lm(y ~ x + x^2, data=DAT) boot - bootstrap(fit, c(coef(fit), predict(fit, newdata = NEWDATA))) CIs - limits.bca(boot) lines(NEWDATA$x, CIs[4:53,1], col=red) lines(NEWDATA$x, CIs[4:53,4], col=red) CIs[1:3,] I used x + x^2 in the model rather than poly(x,2), because poly is data dependent, so regression coefficients cannot be used for new data, and confidence intervals for the coefficients are not meaningful. Comment - the default is 1000 bootstrap samples; that isn't really enough for BCa intervals, because the BCa calculations magnify the Monte Carlo standard error by roughly a factor of two. Jacob Wegelin wrote: Sometimes one might like to obtain pointwise bootstrap bias-corrected, accelerated (BCA) confidence intervals for a large number of statistics computed from a single dataset. For instance, one might like to get (so as to plot graphically) bootstrap confidence bands for the fitted values in a regression model. (Example: Chiu S et al., Early Acceleration of Head Circumference in Children with Fragile X Syndrome and Autism. Journal of Developmental Behavioral Pediatrics 2007;In press. In this paper we plot the estimated trajectories of head circumference for two different groups, computed by linear mixed-effects models, with confidence bands obtained by bootstrap.) Below is a toy example of how to do this using the boot library. We obtain BCA CIs for all three regression parameters and for the fitted values at 50 levels of the predictor. set.seed(1234567) x-runif(150) y-2/3 + pi * x^2 + runif(length(x))/2 plot(x,y) DAT-data.frame(x,y) NEWDATA-data.frame(x=seq(min(x), max(x), length=50)) library('boot') myfn-function(data, whichrows) { TheseData-data[whichrows,] thisLM-lm( y~poly(x,2), data=TheseData) thisFit-predict(thisLM, newdata=NEWDATA) c( coef(summary(thisLM))[,Estimate] , thisFit) } bootObj-boot( data=DAT, statistic=myfn, R=1000 ) names(bootObj) dim(bootObj$t) sofar-t(sapply( 1:ncol(bootObj$t), function(thiscolumn) boot.ci(bootObj, type='bca', index=thiscolumn)$bca[4:5] )) colnames(sofar)-c(lo, hi) NEWDATA-cbind(NEWDATA, sofar[4:nrow(sofar),]) thecoefs-sofar[1:3,] lines( NEWDATA$x, NEWDATA$lo, col='red') lines( NEWDATA$x, NEWDATA$hi, col='red') Note: To get boot.ci to run with type='bca' it seems necessary to have a large value of R. Otherwise boot.ci returns an error, in my (limited) experience. Thanks in advance for any critiques. (For instance, is there an easier or more elegant way?) Caveat - I helped create S+Resample. | Tim Hesterberg Senior Research Scientist | | [EMAIL PROTECTED] Insightful Corp.| | (206)802-23191700 Westlake Ave. N, Suite 500 | | (206)283-8691 (fax) Seattle, WA 98109-3044, U.S.A. | | www.insightful.com/Hesterberg | Download S+Resample from www.insightful.com/downloads/libraries Bootstrap short courses: May 21-22 Philadelphia, Oct 10-11 San Francisco. 2-3 May UK, 3-4 Oct UK. http://www.insightful.com/services/training.asp Workshop on resampling for teaching: May 16 Ohio State http://www.causeweb.org/workshop/hesterberg/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] RE : Help to solve matrices
a-array(c(3,4,1),dim=c(3,1)) b-a%*%a solve(b) amna khan [EMAIL PROTECTED] a écrit : Sir I am new user of R. I am facing problems in solving matrices. for example a-array(c(3,4,1),dim=c(3,1)) b-a%o%a b , , 1, 1 [,1] [1,]9 [2,] 12 [3,]3 , , 2, 1 [,1] [1,] 12 [2,] 16 [3,]4 , , 3, 1 [,1] [1,]3 [2,]4 [3,]1 solve(b) Error in solve.default(b) : only square matrices can be inverted solve(b,a) Error in solve.default(b, a) : 'b' must be compatible with 'a' Sir I request you to help me in this regard. AMINA SHAHZAD Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Justin BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Quick Question about R
Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it converts a letter. Is there another function out there that will do what I need or is there a way to turn off the warnings as I don't want the warning to be displayed to the end user? Konrad Hammel Engineer Prilink LTD [EMAIL PROTECTED] 905.305.1096 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] RE : Help to solve matrices
Justin, Did you actually run that code? :-) a-array(c(3,4,1),dim=c(3,1)) b-a%*%a Error in a %*% a : non-conformable arguments I suspect that Amina wants: a - array(c(3, 4, 1), dim=c(3, 1)) b - t(a) %*% a solve(b) [,1] [1,] 0.03846154 or perhaps: solve(crossprod(a)) [,1] [1,] 0.03846154 Amina, note that %o% is an 'outer' product, not an 'inner' product. See ?outer and ?%*% HTH, Marc Schwartz On Wed, 2007-01-31 at 20:21 +0100, justin bem wrote: a-array(c(3,4,1),dim=c(3,1)) b-a%*%a solve(b) amna khan [EMAIL PROTECTED] a crit : Sir I am new user of R. I am facing problems in solving matrices. for example a-array(c(3,4,1),dim=c(3,1)) b-a%o%a b , , 1, 1 [,1] [1,]9 [2,] 12 [3,]3 , , 2, 1 [,1] [1,] 12 [2,] 16 [3,]4 , , 3, 1 [,1] [1,]3 [2,]4 [3,]1 solve(b) Error in solve.default(b) : only square matrices can be inverted solve(b,a) Error in solve.default(b, a) : 'b' must be compatible with 'a' Sir I request you to help me in this regard. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Quick Question about R
suppressWarnings(a - as.numeric(c(1, 2, pi, a, 9, z))) b On Jan 31, 2007, at 2:35 PM, Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it converts a letter. Is there another function out there that will do what I need or is there a way to turn off the warnings as I don't want the warning to be displayed to the end user? Konrad Hammel Engineer Prilink LTD [EMAIL PROTECTED] 905.305.1096 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Quick Question about R
Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it converts a letter. Is there another function out there that will do what I need or is there a way to turn off the warnings as I don't want the warning to be displayed to the end user? ?options options(warn = -1) as.numeric(c(1,A,2)) [1] 1 NA 2 options(warn = 0) # return to default Konrad Hammel Engineer Prilink LTD [EMAIL PROTECTED] 905.305.1096 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Random Sampling pointers?
Hello all, I have a population of 112 servers that are experiencing different levels of packet loss. I don't want to poll all 112 of them (the analytical tools must be manually run on each individually) so it seems best to sample among them; then I plan on using R to run comparisons of the data pulled from each one. I'm not clear on the most sound way to go about this and I don't want to invalidate my results through any kind of sampling error. Thanks in advance, Pete server,location,level of packet loss(%) 1,1,10 2,1,10 3,1,10 4,1,10 5,1,15 6,1,20 7,1,20 8,1,20 9,1,25 10,1,25 11,1,25 12,1,25 13,1,30 14,1,30 15,1,30 16,1,35 17,1,35 18,1,35 19,1,45 20,1,45 21,1,45 22,1,50 23,1,50 24,1,5 25,1,5 26,1,5 27,1,5 28,1,5 29,1,5 30,1,5 31,1,5 32,1,5 33,1,5 34,1,5 35,1,5 36,1,5 37,1,5 38,1,5 39,1,5 40,1,5 41,1,5 42,1,5 43,1,5 44,1,5 45,1,5 46,1,5 47,1,5 48,1,5 49,1,5 50,1,5 51,1,5 52,1,5 53,1,5 54,1,5 55,1,5 56,1,5 57,1,5 58,1,5 59,1,5 60,1,5 61,1,5 62,1,5 63,1,5 64,1,5 65,2,15 66,2,15 67,2,25 68,2,25 69,2,25 70,2,25 71,2,5 72,2,5 73,2,5 74,2,5 75,2,5 76,2,5 77,2,;5 78,2,5 79,2,5 80,2,5 81,3,10 82,3,15 83,3,15 84,3,15 85,4,10 86,4,15 87,4,15 88,4,20 89,4,25 90,4,25 91,4,25 92,4,25 93,4,30 94,4,30 95,4,30 96,4,35 97,4,50 98,4,50 99,4,5 100,4,5 101,4,5 102,4,5 103,4,5 104,4,5 105,4,5 106,4,5 107,4,5 108,4,5 109,4,5 110,4,5 111,4,5 112,4,5 - always stay connected to friends. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Quick Question about R
On Wed, 2007-01-31 at 14:35 -0500, Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it converts a letter. Is there another function out there that will do what I need or is there a way to turn off the warnings as I don't want the warning to be displayed to the end user? If you provide an example of your data, we can offer more definitive assistance, especially if the formats are in a regular pattern. However, you might want to look at: ?gsub (and perhaps ?regex) ?strsplit ?substr ?strtrim One quick example: V - paste(sample(c(LETTERS, 0:9), 20), collapse = ) V [1] D7YL1N5U2H8QCS03RXMZ gsub([A-Z], , V) [1] 7152803 as.numeric(gsub([A-Z], , V)) [1] 7152803 HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Quick Question about R
On 31-Jan-07 Konrad wrote: Hello, Is there a way to convert a character to a number with out getting a warning? I have a vector that has both numbers and letters in it and I need to convert it to only numbers. At the moment I'm using as.numeric but it is generating a warning when it converts a letter. Is there another function out there that will do what I need or is there a way to turn off the warnings as I don't want the warning to be displayed to the end user? Have a look at the entries warn and warning.expression under ?options In particular: options()$warn [1] 0 x - c(1,2,C,4,E,6,G) as.numeric(x) [1] 1 2 NA 4 NA 6 NA Warning message: NAs introduced by coercion old.warn - options()$warn options(warn = -1) as.numeric(x) [1] 1 2 NA 4 NA 6 NA options(warn = old.warn) as.numeric(x) [1] 1 2 NA 4 NA 6 NA Warning message: NAs introduced by coercion Note that options(warn = -1) turns off all warning messages everywhere, so you may want to bracket your calls to as.numeric() in the way shown above, to avoid intefering with other cases where you may want the user to see the warning. Hoping this helps, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 31-Jan-07 Time: 19:59:33 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Quick Question about R
On 31-Jan-07 Benilton Carvalho wrote: suppressWarnings(a - as.numeric(c(1, 2, pi, a, 9, z))) Of course! Much better! Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 31-Jan-07 Time: 20:02:25 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Quick Question about R
On Wed, 2007-01-31 at 20:02 +, [EMAIL PROTECTED] wrote: On 31-Jan-07 Benilton Carvalho wrote: suppressWarnings(a - as.numeric(c(1, 2, pi, a, 9, z))) Of course! Much better! Ted. In the context of my prior reply: # Bear in mind that the above vector is of class character, not mixed... str(c(1, 2, pi, a, 9, z)) chr [1:6] 1 2 3.14159265358979 a 9 z class(c(1, 2, pi, a, 9, z)) [1] character Thus: grep([0-9\\.], Vec, value = TRUE) [1] 123.14159265358979 [4] 9 as.numeric(grep([0-9\\.], Vec, value = TRUE)) [1] 1.00 2.00 3.141593 9.00 or: gsub([A-Za-z], , Vec) [1] 123.14159265358979 [4] 9 as.numeric(gsub([A-Za-z], , Vec)) [1] 1.00 2.00 3.141593 NA 9.00 NA The latter solution returns the NA's for non-convertible elements, whereas the former, only the resultant numerics. My preference is to be proactive in managing the data rather than disabling warnings. :-) HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] what is the purpose of an error message in uniroot?
Hi all, This is probably a blindingly obvious question: Why does it matter in the uniroot function whether the f() values at the end points that you supply are of the same sign? For example: f - function(x,y) {y-x^2+1} #this gives a warning uniroot(f,interval=c(-5,5),y=0) Error in uniroot(f, interval=c(-5, 5), y = 0) : f() values at end points not of opposite sign #this doesn't give a warning uniroot(f,interval=c(.1,5),y=0) $root [1] 1 $f.root [1] 1.054e-05 $iter [1] 9 $estim.prec [1] 6.104e-05 If I comment out the two lines of script in the uniroot function that produce this warning and create a new function, call it uniroot2, everything works as I'd like. But for didactic purposes, why did the creators of uniroot want the f() values at endpoints to be of opposite sign? Thanks in advance, Matt __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] what is the purpose of an error message in uniroot?
[EMAIL PROTECTED] wrote: This is probably a blindingly obvious question: Yes, it is. Why does it matter in the uniroot function whether the f() values at the end points that you supply are of the same sign? Plot some graphs. Think about the *name* of the function --- *uni*root. Does that ring any bells? And how do you know there *is* a root in the interval in question? Try your ``uniroot2'' on f(x) = 1+x^2 and the interval [-5,5]. To belabour the point --- if the f() values are of the same sign, then there are 0, or 2, or 4, or roots in the interval in question. The ***only chance*** you have of there being a unique root is if the f() values are of opposite sign. The algorithm used and the precision estimates returned presumably depend on the change of sign. You can get answers --- sometimes --- if the change of sign is not present, but the results could be seriously misleading. Without the opposite sign requirement the user will often wind up trying to do something impossible or getting results about which he/she is deluded. cheers, Rolf Turner [EMAIL PROTECTED] P. S. If the f() values are of the same sign, uniroot() DOES NOT give a warning! It gives an error. R. T. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] possible spam alert
The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? If I am doing this correctly, you should see the subject possible spam alert in the subject header of THIS message. Would the moderators of the lists please check and see if I am doing some wrong and, if not, inform Mr. Connolly that I am not. If others have received this message in error, it is possible it is spam and users should be alerted. Thanks, Mark Mark W. Kimpel MD Official Business Address: Department of Psychiatry Indiana University School of Medicine PR M116 Institute of Psychiatric Research 791 Union Drive Indianapolis, IN 46202 This is a request to anyone who starts a new subject to begin with a new message and NOT reply to an existing one. If your mail client is any good, it's very simple to set up an alias (mine is simply 'r') so that the tedious task of typing 'r-help@stat.math.ethz.ch' is unnecessary and it's quicker than scrolling through an address book. It's also quicker than deleting the previous subject. Most mornings, I have over a screenful of messages mostly from R-help and it's very useful to have them threaded. However, the usefulness of threading is lost when posters reply to a message and then change the subject instead of creating a new message. People who don't have a mail client that can display email in threads are probably unaware that this sort of thing can happen in ones that do: 37 N 25 Jan Luis Silva ( 34) [R] plot/screen 38 N 25 Jan Uwe Ligges ( 55) `- 39 N 25 Jan Fernando Henrique Ferra ( 20) [R] Plotting coloured histograms - 40 N 26 Jan Mohamed A. Kerasha ( 12) |-[R] Distributions. 41 N 26 Jan [EMAIL PROTECTED] ( 26) | |- 42 26 Jan Qin Xin ( 9) | `-[R] how could I add legends 43 27 Jan Ko-Kang Kevin Wang ( 31) | `- 44 N 26 Jan Remigijus Lapinskas ( 32) |-Re: [R] Plotting coloured his 45 N 26 Jan Damon Wischik (125) `- 46 N 25 Jan [EMAIL PROTECTED] ( 10) [R] plotting primatives, ellipse 47 N 25 Jan Uwe Ligges ( 19) `- As Martin Maechler explained some time ago, it also screws up the archives for a similar reason. Your cooperation will be greatly appreciated. best -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_Middle minds discuss events (:_~*~_:)Small minds discuss people (_)-(_) . Anon ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] possible spam alert
On 1/31/2007 5:38 PM, Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. Your last message (subject [R] regexpr and parsing question) shows up in my reader as a reply to a message by Gabor Grothendieck with subject Re: [R] change plotting symbol for groups in trellis graph, because it has this line in the header: In-Reply-To: [EMAIL PROTECTED] and his message had this in the header: Message-ID: [EMAIL PROTECTED] That's what Patrick was complaining about. You probably found Gabor's message in the group, hit Reply, and then edited the subject line to make it unique. Your mailer remembered that it was a reply to Gabor's message, and told everyone that, even though it wasn't really. Instead, if you want to write to R-help, just start a new message, and send it to [EMAIL PROTECTED] (or r-help@stat.math.ethz.ch). Duncan Murdoch When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? If I am doing this correctly, you should see the subject possible spam alert in the subject header of THIS message. Would the moderators of the lists please check and see if I am doing some wrong and, if not, inform Mr. Connolly that I am not. If others have received this message in error, it is possible it is spam and users should be alerted. Thanks, Mark Mark W. Kimpel MD Official Business Address: Department of Psychiatry Indiana University School of Medicine PR M116 Institute of Psychiatric Research 791 Union Drive Indianapolis, IN 46202 This is a request to anyone who starts a new subject to begin with a new message and NOT reply to an existing one. If your mail client is any good, it's very simple to set up an alias (mine is simply 'r') so that the tedious task of typing 'r-help@stat.math.ethz.ch' is unnecessary and it's quicker than scrolling through an address book. It's also quicker than deleting the previous subject. Most mornings, I have over a screenful of messages mostly from R-help and it's very useful to have them threaded. However, the usefulness of threading is lost when posters reply to a message and then change the subject instead of creating a new message. People who don't have a mail client that can display email in threads are probably unaware that this sort of thing can happen in ones that do: 37 N 25 Jan Luis Silva ( 34) [R] plot/screen 38 N 25 Jan Uwe Ligges ( 55) `- 39 N 25 Jan Fernando Henrique Ferra ( 20) [R] Plotting coloured histograms - 40 N 26 Jan Mohamed A. Kerasha ( 12) |-[R] Distributions. 41 N 26 Jan [EMAIL PROTECTED] ( 26) | |- 42 26 Jan Qin Xin ( 9) | `-[R] how could I add legends 43 27 Jan Ko-Kang Kevin Wang ( 31) | `- 44 N 26 Jan Remigijus Lapinskas ( 32) |-Re: [R] Plotting coloured his 45 N 26 Jan Damon Wischik (125) `- 46 N 25 Jan [EMAIL PROTECTED] ( 10) [R] plotting primatives, ellipse 47 N 25 Jan Uwe Ligges ( 19) `- As Martin Maechler explained some time ago, it also screws up the archives for a similar reason. Your cooperation will be greatly appreciated. best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] possible spam alert
Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? No. Breach of netiquette, yes. The message in question starts a new thread, yet contains an In-Reply-To: header line, which presumably means that you started writing the message as a reply to something completely unrelated, specifically: Re: [R] change plotting symbol for groups in trellis graph. You should not do that, unless you know how to remove the In-Reply-To line (and this is not obvious in many mail clients); changing the subject is not sufficient. If I am doing this correctly, you should see the subject possible spam alert in the subject header of THIS message. Would the moderators of the lists please check and see if I am doing some wrong and, if not, inform Mr. Connolly that I am not. If others have received this message in error, it is possible it is spam and users should be alerted. Thanks, Mark Mark W. Kimpel MD Official Business Address: Department of Psychiatry Indiana University School of Medicine PR M116 Institute of Psychiatric Research 791 Union Drive Indianapolis, IN 46202 This is a request to anyone who starts a new subject to begin with a new message and NOT reply to an existing one. If your mail client is any good, it's very simple to set up an alias (mine is simply 'r') so that the tedious task of typing 'r-help@stat.math.ethz.ch' is unnecessary and it's quicker than scrolling through an address book. It's also quicker than deleting the previous subject. Most mornings, I have over a screenful of messages mostly from R-help and it's very useful to have them threaded. However, the usefulness of threading is lost when posters reply to a message and then change the subject instead of creating a new message. People who don't have a mail client that can display email in threads are probably unaware that this sort of thing can happen in ones that do: 37 N 25 Jan Luis Silva ( 34) [R] plot/screen 38 N 25 Jan Uwe Ligges ( 55) `- 39 N 25 Jan Fernando Henrique Ferra ( 20) [R] Plotting coloured histograms - 40 N 26 Jan Mohamed A. Kerasha ( 12) |-[R] Distributions. 41 N 26 Jan [EMAIL PROTECTED] ( 26) | |- 42 26 Jan Qin Xin ( 9) | `-[R] how could I add legends 43 27 Jan Ko-Kang Kevin Wang ( 31) | `- 44 N 26 Jan Remigijus Lapinskas ( 32) |-Re: [R] Plotting coloured his 45 N 26 Jan Damon Wischik (125) `- 46 N 25 Jan [EMAIL PROTECTED] ( 10) [R] plotting primatives, ellipse 47 N 25 Jan Uwe Ligges ( 19) `- As Martin Maechler explained some time ago, it also screws up the archives for a similar reason. Your cooperation will be greatly appreciated. best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] possible spam alert
Peter, Thanks you for your explanation, I had taken Mr. Connolly's message to me to imply that I was not changing the subject line. I use MS Outlook 2007 and, unless I am just not seeing it, Outlook does not normally display the in reply to header, I was under the mistaken impression that that was what the Subject line was for. See, for example, the header to your message to me below. Outlook will, however, sort messages by Subject, and that is what I thought was meant by threading. Well, I learned something today and apologize for any inconvenience my posts may have caused. BTW, I use Outlook because it is supported by my university server and will synch my appointments and contacts with my PDA, which runs Windows CE. If anyone has a suggestion for me of a better email program that will provide proper threading AND work with a MS email server and synch with Windows CE, I'd love to hear it. Thanks again, Mark Mark W. Kimpel MD (317) 490-5129 Work, Mobile (317) 663-0513 Home (no voice mail please) 1-(317)-536-2730 FAX -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 6:25 PM To: Kimpel, Mark William Cc: [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: Re: [R] possible spam alert Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? No. Breach of netiquette, yes. The message in question starts a new thread, yet contains an In-Reply-To: header line, which presumably means that you started writing the message as a reply to something completely unrelated, specifically: Re: [R] change plotting symbol for groups in trellis graph. You should not do that, unless you know how to remove the In-Reply-To line (and this is not obvious in many mail clients); changing the subject is not sufficient. If I am doing this correctly, you should see the subject possible spam alert in the subject header of THIS message. Would the moderators of the lists please check and see if I am doing some wrong and, if not, inform Mr. Connolly that I am not. If others have received this message in error, it is possible it is spam and users should be alerted. Thanks, Mark Mark W. Kimpel MD Official Business Address: Department of Psychiatry Indiana University School of Medicine PR M116 Institute of Psychiatric Research 791 Union Drive Indianapolis, IN 46202 This is a request to anyone who starts a new subject to begin with a new message and NOT reply to an existing one. If your mail client is any good, it's very simple to set up an alias (mine is simply 'r') so that the tedious task of typing 'r-help@stat.math.ethz.ch' is unnecessary and it's quicker than scrolling through an address book. It's also quicker than deleting the previous subject. Most mornings, I have over a screenful of messages mostly from R-help and it's very useful to have them threaded. However, the usefulness of threading is lost when posters reply to a message and then change the subject instead of creating a new message. People who don't have a mail client that can display email in threads are probably unaware that this sort of thing can happen in ones that do: 37 N 25 Jan Luis Silva ( 34) [R] plot/screen 38 N 25 Jan Uwe Ligges ( 55) `- 39 N 25 Jan Fernando Henrique Ferra ( 20) [R] Plotting coloured histograms - 40 N 26 Jan Mohamed A. Kerasha ( 12) |-[R] Distributions. 41 N 26 Jan [EMAIL PROTECTED] ( 26) | |- 42 26 Jan Qin Xin ( 9) | `-[R] how could I add legends 43 27 Jan Ko-Kang Kevin Wang ( 31) | `- 44 N 26 Jan Remigijus Lapinskas ( 32) |-Re: [R] Plotting coloured his 45 N 26 Jan Damon Wischik (125) `- 46 N 25 Jan [EMAIL PROTECTED] ( 10) [R] plotting primatives, ellipse 47 N 25 Jan Uwe Ligges ( 19) `- As Martin Maechler explained some time ago, it also screws up the archives for a similar reason. Your cooperation will be greatly appreciated. best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
Re: [R] R for SAS SPSS Users Document
Julien Barnier wrote: ... I think it will be very useful to me, even if I will use it the reverse way : learn how to use SAS from R... I hadn't thought of using the document in reverse to learn SAS or SPSS if you already know R. I'll have to reread it from that perspective see if there are any changes I can make to help in that direction without a total rewrite. If anyone has any suggestions along those lines, please send them my way. Thanks for the PDF tip. Several people suggested that. I thought cutting pasting examples would be important, which is not as easy from PDF. OpenOffice can open the .doc version on Linux if you use that. I have added a PDF version at the same link ending in PDF: http://oit.utk.edu/scc/RforSASSPSSusers.pdf Cheers, Bob = Bob Muenchen (pronounced Min'-chen), Manager Statistical Consulting Center U of TN Office of Information Technology 200 Stokely Management Center, Knoxville, TN 37996-0520 Voice: (865) 974-5230 FAX: (865) 974-4810 Email: [EMAIL PROTECTED] Web: http://oit.utk.edu/scc, News: http://listserv.utk.edu/archives/statnews.html = -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Julien Barnier Sent: Wednesday, January 31, 2007 3:20 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] R for SAS SPSS Users Document Hi, I am pleased to announce the availability of the document, R for SAS and SPSS Users, at http://oit.utk.edu/scc/RforSASSPSSusers.doc I've looked at the document and printed it. I think it will be very useful to me, even if I will use it the reverse way : learn how to use SAS from R... As I am far from an R expert, I will not be able to give you good advices on R code. But maybe you would have had more comments on your tutorial if you had given the link to the PDF version instead of the MSWord one : http://oit.utk.edu/scc/RforSASSPSSusers.pdf Thanks again for your document, -- Julien __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] [BioC] possible spam alert
Hi Mark, I'm sending this off-list because I don't want to unnecessarily fill people's inbox if I'm wrong. I think you are misunderstanding Patrick's problem. The point is kind of subtle and requires a bit of knowledge of how e-mail works. What he is complaining about is that people take a random message on the mailing list, hit reply and then change the subject, as opposed to creating a new message. For most people this ends up being the same: a new message appears with a new subject heading. In some cases, which include the archiving system, the e-mail client tries to organize the e-mails by threads. Because some people tend to change the subject name inside of a thread, there is an additional (hidden) identifier that is used. This means that if you replied to a random message, you are now associated to an unrelated thread, which is annoying at best and can cause your message to be ignored at worst. This is especially true in a high-volume list like R-help, as most people don't want to jump all over to follow a conversation and having a completely irrelevant message inside a conversation is confusing. Hopefully this clarifies the situation. You're not being accused of spamming, but of not following one of the finer points of mailing list etiquette. Given the volume of the lists involved and the time and effort that many people spend in reading and replying to the list, I think it is a good idea to make the extra effort to make sure that everything runs smoothly. Francois On Wed, 2007-01-31 at 17:38 -0500, Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? If I am doing this correctly, you should see the subject possible spam alert in the subject header of THIS message. Would the moderators of the lists please check and see if I am doing some wrong and, if not, inform Mr. Connolly that I am not. If others have received this message in error, it is possible it is spam and users should be alerted. Thanks, Mark Mark W. Kimpel MD Official Business Address: Department of Psychiatry Indiana University School of Medicine PR M116 Institute of Psychiatric Research 791 Union Drive Indianapolis, IN 46202 This is a request to anyone who starts a new subject to begin with a new message and NOT reply to an existing one. If your mail client is any good, it's very simple to set up an alias (mine is simply 'r') so that the tedious task of typing 'r-help@stat.math.ethz.ch' is unnecessary and it's quicker than scrolling through an address book. It's also quicker than deleting the previous subject. Most mornings, I have over a screenful of messages mostly from R-help and it's very useful to have them threaded. However, the usefulness of threading is lost when posters reply to a message and then change the subject instead of creating a new message. People who don't have a mail client that can display email in threads are probably unaware that this sort of thing can happen in ones that do: 37 N 25 Jan Luis Silva ( 34) [R] plot/screen 38 N 25 Jan Uwe Ligges ( 55) `- 39 N 25 Jan Fernando Henrique Ferra ( 20) [R] Plotting coloured histograms - 40 N 26 Jan Mohamed A. Kerasha ( 12) |-[R] Distributions. 41 N 26 Jan [EMAIL PROTECTED] ( 26) | |- 42 26 Jan Qin Xin ( 9) | `-[R] how could I add legends 43 27 Jan Ko-Kang Kevin Wang ( 31) | `- 44 N 26 Jan Remigijus Lapinskas ( 32) |-Re: [R] Plotting coloured his 45 N 26 Jan Damon Wischik (125) `- 46 N 25 Jan [EMAIL PROTECTED] ( 10) [R] plotting primatives, ellipse 47 N 25 Jan Uwe Ligges ( 19) `- As Martin Maechler explained some time ago, it also screws up the archives for a similar reason. Your cooperation will be greatly appreciated. best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 3D histograms
Hi, is there a 3D equivalent for hist2d {gplots} that would give me the 3-dimensional matrix which holds the counts of the number of observed (x,y,z) triplets that fall into each bin ? Many thanks in advance, georgia [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Outlook does threading
See below for Bert Gunter's off list reply to me (which I do appreciate). I'm putting it back on the list because it seems there is still confusion regarding the difference between threading and sorting by subject. I thought the example I will give below will serve as instructional for other Outlook users who may be similarly confused as I was (am?). Per Bert's instructions, I just set up my inbox to sort by subject. I sent one email to myself with the subject test1 and then replied to it without changing the subject. The reply correctly went to test1 in the inbox sorter. I then changed the subject heading in the test1 reply to test2 and sent it to myself. This time Outlook re-categorized it and put it in a separate compartment in the view called test2. If Outlook can do threading the way the R mail server does, I don't think this is the way to do it. Unless someone has an idea of how to correctly set up Outlook to do threading in the manner that the R mail server does, I think the message for us Outlook users is to just create, from scratch, a new message when initiating a new subject. Thanks for all your help. Mark -Original Message- From: Bert Gunter [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 7:03 PM To: Kimpel, Mark William Subject: Outlook does threading Mark: No need to bother the R list with this. Outlook does threading. Just sort on Subject in the viewer. Bert Gunter Genentech Nonclinical Statistics South San Francisco, CA 94404 650-467-7374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kimpel, Mark William Sent: Wednesday, January 31, 2007 3:36 PM To: Peter Dalgaard Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject: Re: [R] possible spam alert Peter, Thanks you for your explanation, I had taken Mr. Connolly's message to me to imply that I was not changing the subject line. I use MS Outlook 2007 and, unless I am just not seeing it, Outlook does not normally display the in reply to header, I was under the mistaken impression that that was what the Subject line was for. See, for example, the header to your message to me below. Outlook will, however, sort messages by Subject, and that is what I thought was meant by threading. Well, I learned something today and apologize for any inconvenience my posts may have caused. BTW, I use Outlook because it is supported by my university server and will synch my appointments and contacts with my PDA, which runs Windows CE. If anyone has a suggestion for me of a better email program that will provide proper threading AND work with a MS email server and synch with Windows CE, I'd love to hear it. Thanks again, Mark Mark W. Kimpel MD (317) 490-5129 Work, Mobile (317) 663-0513 Home (no voice mail please) 1-(317)-536-2730 FAX -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 6:25 PM To: Kimpel, Mark William Cc: [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: Re: [R] possible spam alert Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? No. Breach of netiquette, yes. The message in question starts a new thread, yet contains an In-Reply-To: header line, which presumably means that you started writing the message as a reply to something completely unrelated, specifically: Re: [R] change plotting symbol for groups in trellis graph. You should not do that, unless you know how to remove the In-Reply-To line (and this is not obvious in many mail clients); changing the subject is not sufficient. If I am doing this correctly, you should see the subject possible spam alert in the subject header of THIS message. Would the moderators of the lists please check and see if I am doing some wrong and, if not, inform Mr. Connolly that I am not. If others have received this message in error, it is possible it is spam and users should be alerted. Thanks, Mark Mark W. Kimpel MD Official Business Address: Department of Psychiatry Indiana University School of Medicine PR M116 Institute of Psychiatric Research 791 Union Drive Indianapolis, IN 46202 This is a request to anyone who starts a new subject to begin with a new message and NOT reply to an existing one.
Re: [R] Outlook does threading
Your final paragraph has the take-home message for everyone (not just MS Outlook users): just create, from scratch, a new message when initiating a new subject. Viewing threads can be completely different to sorting based on the subject line. Your initial post with the subject regexpr and parsing question was in fact a reply to the message from Gabor Grothendick in the thread Re: [R] change plotting symbol for groups in trellis graph. (I can see this by looking at the header information: I see a In-reply-to: header item.) When I view threads in the Thunderbird mail reader, your post and replies with the subject regexpr and parsing question do in fact show up under the thread in which Gabor's message appeared, not in their own thread. According to http://office.microsoft.com/en-us/outlook/HA011356671033.aspx, one can view threads in Outlook by selecting View-Arrange By-Conversation. Hope this helps (in case the horse was not thoroughly dead already.) -- Tony Plate Kimpel, Mark William wrote: See below for Bert Gunter's off list reply to me (which I do appreciate). I'm putting it back on the list because it seems there is still confusion regarding the difference between threading and sorting by subject. I thought the example I will give below will serve as instructional for other Outlook users who may be similarly confused as I was (am?). Per Bert's instructions, I just set up my inbox to sort by subject. I sent one email to myself with the subject test1 and then replied to it without changing the subject. The reply correctly went to test1 in the inbox sorter. I then changed the subject heading in the test1 reply to test2 and sent it to myself. This time Outlook re-categorized it and put it in a separate compartment in the view called test2. If Outlook can do threading the way the R mail server does, I don't think this is the way to do it. Unless someone has an idea of how to correctly set up Outlook to do threading in the manner that the R mail server does, I think the message for us Outlook users is to just create, from scratch, a new message when initiating a new subject. Thanks for all your help. Mark -Original Message- From: Bert Gunter [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 7:03 PM To: Kimpel, Mark William Subject: Outlook does threading Mark: No need to bother the R list with this. Outlook does threading. Just sort on Subject in the viewer. Bert Gunter Genentech Nonclinical Statistics South San Francisco, CA 94404 650-467-7374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kimpel, Mark William Sent: Wednesday, January 31, 2007 3:36 PM To: Peter Dalgaard Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject: Re: [R] possible spam alert Peter, Thanks you for your explanation, I had taken Mr. Connolly's message to me to imply that I was not changing the subject line. I use MS Outlook 2007 and, unless I am just not seeing it, Outlook does not normally display the in reply to header, I was under the mistaken impression that that was what the Subject line was for. See, for example, the header to your message to me below. Outlook will, however, sort messages by Subject, and that is what I thought was meant by threading. Well, I learned something today and apologize for any inconvenience my posts may have caused. BTW, I use Outlook because it is supported by my university server and will synch my appointments and contacts with my PDA, which runs Windows CE. If anyone has a suggestion for me of a better email program that will provide proper threading AND work with a MS email server and synch with Windows CE, I'd love to hear it. Thanks again, Mark Mark W. Kimpel MD (317) 490-5129 Work, Mobile (317) 663-0513 Home (no voice mail please) 1-(317)-536-2730 FAX -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 6:25 PM To: Kimpel, Mark William Cc: [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: Re: [R] possible spam alert Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? No. Breach of netiquette, yes. The
[R] rgl.postscript{rgl} crashes R
Hi list, I am trying to print a rgl scene. I can do this with rgl.snapshot(test.pnt,fmt=png), but rgl.postscript(test.pdf,fmt=pdf) does crash R and returns to the linux shell after extented time period. I am running R 2.4.0 on i686 linux mandrake 10.2. Do I need any other R external program to make this work? Thanks Herry Dr Alexander Herr - Herry Spatial and statistical analyst CSIRO, Sustainable Ecosystems Davies Laboratory, University Drive, Douglas, QLD 4814 Private Mail Bag, Aitkenvale, QLD 4814 Phone/www (07) 4753 8510; 4753 8650(fax) Home: http://herry.ausbats.org.au Webadmin ABS: http://ausbats.org.au Sustainable Ecosystems: http://www.cse.csiro.au/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Outlook does threading
You can see how it looks to most readers by viewing it on gmane: http://thread.gmane.org/gmane.comp.lang.r.general/78065 Note that even though the subject has been changed its still listed as a child of another message rather than the start of a new thread. On 1/31/07, Tony Plate [EMAIL PROTECTED] wrote: Your final paragraph has the take-home message for everyone (not just MS Outlook users): just create, from scratch, a new message when initiating a new subject. Viewing threads can be completely different to sorting based on the subject line. Your initial post with the subject regexpr and parsing question was in fact a reply to the message from Gabor Grothendick in the thread Re: [R] change plotting symbol for groups in trellis graph. (I can see this by looking at the header information: I see a In-reply-to: header item.) When I view threads in the Thunderbird mail reader, your post and replies with the subject regexpr and parsing question do in fact show up under the thread in which Gabor's message appeared, not in their own thread. According to http://office.microsoft.com/en-us/outlook/HA011356671033.aspx, one can view threads in Outlook by selecting View-Arrange By-Conversation. Hope this helps (in case the horse was not thoroughly dead already.) -- Tony Plate Kimpel, Mark William wrote: See below for Bert Gunter's off list reply to me (which I do appreciate). I'm putting it back on the list because it seems there is still confusion regarding the difference between threading and sorting by subject. I thought the example I will give below will serve as instructional for other Outlook users who may be similarly confused as I was (am?). Per Bert's instructions, I just set up my inbox to sort by subject. I sent one email to myself with the subject test1 and then replied to it without changing the subject. The reply correctly went to test1 in the inbox sorter. I then changed the subject heading in the test1 reply to test2 and sent it to myself. This time Outlook re-categorized it and put it in a separate compartment in the view called test2. If Outlook can do threading the way the R mail server does, I don't think this is the way to do it. Unless someone has an idea of how to correctly set up Outlook to do threading in the manner that the R mail server does, I think the message for us Outlook users is to just create, from scratch, a new message when initiating a new subject. Thanks for all your help. Mark -Original Message- From: Bert Gunter [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 7:03 PM To: Kimpel, Mark William Subject: Outlook does threading Mark: No need to bother the R list with this. Outlook does threading. Just sort on Subject in the viewer. Bert Gunter Genentech Nonclinical Statistics South San Francisco, CA 94404 650-467-7374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kimpel, Mark William Sent: Wednesday, January 31, 2007 3:36 PM To: Peter Dalgaard Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject: Re: [R] possible spam alert Peter, Thanks you for your explanation, I had taken Mr. Connolly's message to me to imply that I was not changing the subject line. I use MS Outlook 2007 and, unless I am just not seeing it, Outlook does not normally display the in reply to header, I was under the mistaken impression that that was what the Subject line was for. See, for example, the header to your message to me below. Outlook will, however, sort messages by Subject, and that is what I thought was meant by threading. Well, I learned something today and apologize for any inconvenience my posts may have caused. BTW, I use Outlook because it is supported by my university server and will synch my appointments and contacts with my PDA, which runs Windows CE. If anyone has a suggestion for me of a better email program that will provide proper threading AND work with a MS email server and synch with Windows CE, I'd love to hear it. Thanks again, Mark Mark W. Kimpel MD (317) 490-5129 Work, Mobile (317) 663-0513 Home (no voice mail please) 1-(317)-536-2730 FAX -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 6:25 PM To: Kimpel, Mark William Cc: [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: Re: [R] possible spam alert Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this
Re: [R] Outlook does threading
Tony, I went to the MS link that you suggested (see below) and it indeed says that The Arrange by Conversation arrangement shows your e-mail items grouped by message subject or 'thread.' Instead of arranging by subject, I arranged my view by conversation and got exactly the same result that I had gotten when viewing by subject, i.e. MS Outlook looks only at the subject line when deciding on threads, conversations, subjects, or whatever you want to call it. I am, BTW, using Outlook 2007 on Windows XP SP2 and cannot vouch for Outlooks behavior in other versions or configurations. So, no matter what I do, it seems impossible for me to duplicate in Outlook what Gabor pointed out to me when he said, You can see how it looks to most readers by viewing it on gmane: http://thread.gmane.org/gmane.comp.lang.r.general/78065 Note that even though the subject has been changed its still listed as a child of another message rather than the start of a new thread. I did check and of course Gabor is correct. This subject does need to be put to bed. I have reread the posting guide for R-help at http://www.r-project.org/ and it does indeed say Do please create a new email message when posting to the list rather than replying to a previous message and simply changing the subject line! This allows sensible threading in the mailing list archives (and many users e-mail readers). To be honest, I probably read this 3 years ago when I subscribed to the list but, because my email reader doesn't behave this way, I just forgot about it. I email so many people during the day that I frequently hit reply to a previous message and then change the subject if appropriate. So, not to justify my behavior, but would it be possible for the R mail server to somehow check and see if the subject heading on a thread has been changed and then return-to-sender with a standard message explaining everything we have been through tonight? If Patrick Connolly sees this enough to have a standard message he sends out and Martin Maechler commented on it in the past, perhaps other Windows users of Outlook are doing the same thing I did. Rest assured that I have learned my lesson and won't repeat the same mistake, but if such a filter was put in place at the R mail server level, perhaps it would save the non-Outlook users a lot of aggravation. These exchanges have been edifying and I thank all for their patience and explanations. Mark Mark W. Kimpel MD (317) 490-5129 Work, Mobile (317) 663-0513 Home (no voice mail please) 1-(317)-536-2730 FAX -Original Message- From: Tony Plate [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 8:08 PM To: Kimpel, Mark William Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject: Re: [R] Outlook does threading Your final paragraph has the take-home message for everyone (not just MS Outlook users): just create, from scratch, a new message when initiating a new subject. Viewing threads can be completely different to sorting based on the subject line. Your initial post with the subject regexpr and parsing question was in fact a reply to the message from Gabor Grothendick in the thread Re: [R] change plotting symbol for groups in trellis graph. (I can see this by looking at the header information: I see a In-reply-to: header item.) When I view threads in the Thunderbird mail reader, your post and replies with the subject regexpr and parsing question do in fact show up under the thread in which Gabor's message appeared, not in their own thread. According to http://office.microsoft.com/en-us/outlook/HA011356671033.aspx, one can view threads in Outlook by selecting View-Arrange By-Conversation. Hope this helps (in case the horse was not thoroughly dead already.) -- Tony Plate Kimpel, Mark William wrote: See below for Bert Gunter's off list reply to me (which I do appreciate). I'm putting it back on the list because it seems there is still confusion regarding the difference between threading and sorting by subject. I thought the example I will give below will serve as instructional for other Outlook users who may be similarly confused as I was (am?). Per Bert's instructions, I just set up my inbox to sort by subject. I sent one email to myself with the subject test1 and then replied to it without changing the subject. The reply correctly went to test1 in the inbox sorter. I then changed the subject heading in the test1 reply to test2 and sent it to myself. This time Outlook re-categorized it and put it in a separate compartment in the view called test2. If Outlook can do threading the way the R mail server does, I don't think this is the way to do it. Unless someone has an idea of how to correctly set up Outlook to do threading in the manner that the R mail server does, I think the message for us Outlook users is to just create, from scratch, a new message when initiating a new subject. Thanks for all your help. Mark -Original
[R] memory-efficient column aggregation of a sparse matrix
I need to sum the columns of a sparse matrix according to a factor - ie given a sparse matrix X and a factor fac of length ncol(X), sum the elements by column factors and return the sparse matrix Y of size nrow(X) by nlevels(f). The appended code does the job, but is unacceptably memory-bound because tapply() uses a non-sparse representation. Can anyone suggest a more memory and cpu efficient approach? Eg, a sparse matrix tapply method? Thanks. -- +--+ | Jon Stearley (505) 845-7571 (FAX 844-9297) | | Sandia National Laboratories Scalable Systems Integration | +--+ # x and y are of SparseM class matrix.csr aggregate.csr - function(x, fac) { # make a vector indicating the row of each nonzero rows - integer(length=length([EMAIL PROTECTED])) [EMAIL PROTECTED]:nrow(x)]] - 1 # put a 1 at start of each row rows - as.integer(cumsum(rows)) # and finish with a cumsum # make a vector indicating the column factor of each nonzero f - [EMAIL PROTECTED] # aggregate by row,f y - tapply([EMAIL PROTECTED], list(rows,f), sum) # sparsify it y[is.na(y)] - 0 # change tapply NAs to as.matrix.csr 0s y - as.matrix.csr(y) y } __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] traverse through many columns of a matrix in a function
Hello everyone, Here is the setup. z is a 119 x 15 matrix, m_index is a 119 x 5 matrix What I am trying to do is return the results from fitCopula by sequentially binding all 15 columns of z to the first column of m_index, (cbind(z[,1],m_index[,1]),(cbind(z[,2],m_index[,1]), etc. Unfortunately, my code below only binds z[,1] and m_index[,1] and return the same result 14 times. Any ideas on how to implement my idea would be greatly appreciated. Also, why am I getting the same result 14 times, shouldn't it be 15 since there are 15 columns in z? my.cop - normalCopula(param = 0.5, dim = 2) answer - apply(z[,-1], 2, function(m_index[,1],my.cop) fitCopula(cbind(z[,-1], m_index[,1]), my.cop, start=0.3), my.cop = my.cop) Thanks for help. Adam (aat) -- View this message in context: http://www.nabble.com/traverse-through-many-columns-of-a-matrix-in-a-function-tf3152747.html#a8742152 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rgl.postscript{rgl} crashes R
On 1/31/2007 8:15 PM, [EMAIL PROTECTED] wrote: Hi list, I am trying to print a rgl scene. I can do this with rgl.snapshot(test.pnt,fmt=png), but rgl.postscript(test.pdf,fmt=pdf) does crash R and returns to the linux shell after extented time period. I am running R 2.4.0 on i686 linux mandrake 10.2. Do I need any other R external program to make this work? You aren't using the latest R, and probably aren't using the latest rgl. Try updating both: R to 2.4.1, rgl to 0.70. The rgl ChangeLog shows this for 0.70: - fixed bug in rgl.postscript in Linux, added text support to it __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Loading functions in R
Hi all, This information must be out there, but I can't seem to find it. What I want to do is to store functions I've created (as .R files or in whatever form) and then load them when I need them (or on startup) so that I can access without cluttering my program with the function code. This seems like it should be easy, but Thanks! Jeff __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] [BioC] Outlook does threading [Broadcast]
This is really off-topic for both BioC and R-help, so I'll keep it short. From: Kimpel, Mark William See below for Bert Gunter's off list reply to me (which I do appreciate). I'm putting it back on the list because it seems there is still confusion regarding the difference between threading and sorting by subject. I thought the example I will give below will serve as instructional for other Outlook users who may be similarly confused as I was (am?). Per Bert's instructions, I just set up my inbox to sort by subject. I sent one email to myself with the subject test1 and then replied to it without changing the subject. The reply correctly went to test1 in the inbox sorter. I then changed the subject heading in the test1 reply to test2 and sent it to myself. This time Outlook re-categorized it and put it in a separate compartment in the view called test2. If Outlook can do threading the way the R mail server does, I don't think this is the way to do it. AFAIK there's no proper way to get the correct threading in Outlook. What I do is group by conversation topic, but that doesn't solve the problem. This is only problem on your (and all Outlook users'?) end, though. The bigger problem that affects the lists is that some versions of MS Exchange Server do not include the In-reply-to header field that many mailing lists rely on for proper threading. As a result, when I reply to other people's post, it may show up in Outlook as having been threaded properly (because the subject is fine), but it throws everything else that does proper threading off. Unless someone has an idea of how to correctly set up Outlook to do threading in the manner that the R mail server does, Maybe some VBA coding can be done to get it right, but short of that, I very much doubt it. I think the message for us Outlook users is to just create, from scratch, a new message when initiating a new subject. That message ought to be clear for everyone. You should never reply to a message when you really mean to start a new topic, regardless what you are using. Andy Thanks for all your help. Mark -Original Message- From: Bert Gunter [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 7:03 PM To: Kimpel, Mark William Subject: Outlook does threading Mark: No need to bother the R list with this. Outlook does threading. Just sort on Subject in the viewer. Bert Gunter Genentech Nonclinical Statistics South San Francisco, CA 94404 650-467-7374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kimpel, Mark William Sent: Wednesday, January 31, 2007 3:36 PM To: Peter Dalgaard Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject: Re: [R] possible spam alert Peter, Thanks you for your explanation, I had taken Mr. Connolly's message to me to imply that I was not changing the subject line. I use MS Outlook 2007 and, unless I am just not seeing it, Outlook does not normally display the in reply to header, I was under the mistaken impression that that was what the Subject line was for. See, for example, the header to your message to me below. Outlook will, however, sort messages by Subject, and that is what I thought was meant by threading. Well, I learned something today and apologize for any inconvenience my posts may have caused. BTW, I use Outlook because it is supported by my university server and will synch my appointments and contacts with my PDA, which runs Windows CE. If anyone has a suggestion for me of a better email program that will provide proper threading AND work with a MS email server and synch with Windows CE, I'd love to hear it. Thanks again, Mark Mark W. Kimpel MD (317) 490-5129 Work, Mobile (317) 663-0513 Home (no voice mail please) 1-(317)-536-2730 FAX -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 6:25 PM To: Kimpel, Mark William Cc: [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: Re: [R] possible spam alert Kimpel, Mark William wrote: The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this fashion. When I emailed him to give me a specific example, he did not reply. The most recent thread that he seems concerned about was to the R list and was entitled regexpr and parsing question . I believe the previous post of mine that he had problems with was to the BioC list but I can't remember its subject. Is this spam? No. Breach of netiquette, yes. The
[R] Combining two datasets
Dear all R users, Suppose I have two data sets: data1: 1,3,5,7,9 data2: 2,4,6,8 Now I want to combine these two data sets like that: data = 1,2,3,4,5,6,7,8,9 Can anyone tell me how to do that? Thanks and regards, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Loading functions in R
The recommended approach is to make a package for your functions that will include documentation, error checks etc. Another way to accomplish what you want is to start a new R session and 'source' your .R files and then to save the workspace in a .RData file, e.g. myFunctions.RData. Finally attach(myFunctions.RData) should do the trick without cluttering your workspace. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Forest Floor Sent: Wednesday, January 31, 2007 10:41 PM To: r-help@stat.math.ethz.ch Subject: [R] Loading functions in R Hi all, This information must be out there, but I can't seem to find it. What I want to do is to store functions I've created (as .R files or in whatever form) and then load them when I need them (or on startup) so that I can access without cluttering my program with the function code. This seems like it should be easy, but Thanks! Jeff __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] line plot
Hello sir: I wanna get such kind of plot: a line whose start point is(1,10),end point is(5,10) In other words: How can I draw a line if I only know the coordinate of the start point and end point? Thanks! My best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] prop.test() references
Dear R-help, I'm using prop.test() to compute a confidence interval for a proportion under R version 2.4.1, as in: prop.test(x = 340, n = 400)$conf [1] 0.8103309 0.8827749 I have two questions: 1) from the source code my understanding is that the confidence interval is computed according to Wilson, E.B. (1927) Probable inference, the law of succession, and statistical inference. J. Am. Stat. Assoc., 22:209-212. Is it correct? 2) The doc says Continuity correction is used only if it does not exceed the difference between sample and null proportions in absolute value. Does someone has a reference in which this point is discussed? Best, -- Jean R. Lobry([EMAIL PROTECTED]) Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I, 43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE allo : +33 472 43 27 56 fax: +33 472 43 13 88 http://pbil.univ-lyon1.fr/members/lobry/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] line plot
Hi see ?segments segments(1,10,5,10) HTH Petr On 1 Feb 2007 at 14:21, XinMeng wrote: From: XinMeng [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Date sent: Thu, 01 Feb 2007 14:21:34 +0800 Subject:[R] line plot Send reply to: XinMeng [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Hello sir: I wanna get such kind of plot: a line whose start point is(1,10),end point is(5,10) In other words: How can I draw a line if I only know the coordinate of the start point and end point? Thanks! My best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] features of save and save.image (unexpected file sizes)
Hi, On 1/31/07, Professor Brian Ripley [EMAIL PROTECTED] wrote: Two comments: 1) ls() does not list all the objects: it has all.names argument. Yes, I tried it with all.names, but the effect was the same, I forgot to mention it in a letter. 2) save.image() does not just save the objects in the workspace, it also saves any environments they may have. Having a function with a large environment is the usual cause of a large saved image. I have little experience dealing with environments, so is there a quick way to discard the environments of the functions? When saving the session I really do not need them. (And finally, a compressed binary representation from save.image is nor comparable sizewise with an ASCII version from dump.) I know, but thus I found out that I am saving something besides my large object. Thanks very much for your answer! Vaidotas Zemlys -- Doctorate student, http://www.mif.vu.lt/katedros/eka/katedra/zemlys.php Vilnius University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.