Re: [Rd] feature request: optim() iteration of functions that return multiple values

2023-08-10 Thread Greg Snow
Another option that is similar to Enrico's is to use object oriented programming with R6 or reference objects. I prefer the R6 package (which will still use an environment like Enrico, but with some different syntax and a little easier if you want to do this multiple times. Here is some example

Re: [Rd] anova and intercept

2022-12-27 Thread Greg Snow
Why compute the differences manually when `aov` can do paired comparisons on this data as is: summary(aov(extra ~ factor(group) + Error(ID), data=sleep )) gives the same F and P values On Tue, Dec 27, 2022 at 3:32 AM Gabor Grothendieck wrote: > > Good idea. > > On Mon, Dec 26, 2022 at 12:59

Re: [Rd] New pipe operator and gg plotz

2020-12-09 Thread Greg Snow
Since `+` is already a function we could do regular piping to change this code: mtcars %>% ggplot(aes(x=wt, y=mpg)) + geom_point() to this: mtcars %>% ggplot(aes(x=wt, y=mpg)) %>% `+`(geom_point()) Further we can write wrapper functions like: p_geom_point <- function(x,...) { x +

Re: [Rd] Different results for tan(pi/2) and tanpi(1/2)

2016-09-09 Thread Greg Snow
If pi were stored and computed to infinite precision then yes we would expect tan(pi/2) to be NaN, but computers in general and R specifically don't store to infinite precision (some packages allow arbitrary (but still finite) precision) and irrational numbers cannot be stored exactly. So you

Re: [Rd] [FORGED] Different results based on the order of arguments to par

2016-03-15 Thread Greg Snow
'') > abline( v=1, col='red') > > sp.par <- subplot(hist(rnorm(100), main=''), x='topright') > > subplotadd <- function(fun, pars) { > par(new=TRUE) > par(pars['plt']) > plot.new() > par(pars['usr']) > fun > } >

Re: [Rd] [FORGED] Different results based on the order of arguments to par

2016-03-15 Thread Greg Snow
lot > # (though plot.window() might be better here) > par(usr=c(0,1,0,1)) > # Start drawing > box() > points(c(0,1), c(0,1), pch=16, col='red', cex=3) > > Is there a good argument against doing that? > > Paul > > > On 15/03/16 10:27, Greg Snow wrote: >&

[Rd] Different results based on the order of arguments to par

2016-03-14 Thread Greg Snow
issue: 1. consider that this is a rare enough issue that only Greg Snow will ever care and he has already learned the lesson, so do nothing (other than laugh at Greg when he forgets and has to remember to properly order his par arguments). 2. Since this came up as an issue with subplot, force

Re: [Rd] Inconsistency in treating NaN-results?

2015-11-30 Thread Greg Snow
R and the S language that it is based on has evolved as much as it has been designed, so there are often inconsistencies due similar functionality evolving from different paths. In some cases these inconsistencies are resolved, but generally only once someone notices and care enough to do

Re: [Rd] Why doesn't R have a float data type?

2015-06-30 Thread Greg Snow
My understanding is that R does have a float type, it is just called double instead of float. If you are referring to a single precision floating point type, then R does have the as.single function, but that does not really change the way the number is stored, just sets a flag so that the proper

Re: [Rd] is.whole()

2014-10-28 Thread Greg Snow
Just to anticipate future discussion from math purists (and hopefully not to throw too much of a wrench in the works), what would be the return of: is.whole(-1) or is.whole(-1L) ? I can see arguments for both TRUE and FALSE from both the math purity group and the what will happen when I try

Re: [Rd] Looking for new maintainer of orphans R2HTML SemiPar cghseg hexbin lgtdl monreg muhaz operators pamr

2014-09-05 Thread Greg Snow
Uwe, Have all of these packages found new maintainers? if not, which ones are still looking to be adopted? thanks, On Fri, Aug 8, 2014 at 10:41 AM, Uwe Ligges uwe.lig...@r-project.org wrote: Dear maintainers and R-devel, Several orphaned CRAN packages are about to be archived due to

Re: [Rd] dput line width

2014-05-27 Thread Greg Snow
Looking at the help file and code for dput does not show any simple way to do what you want. But the help page makes reference to the deparse function and deparse does have a width.cutoff argument. So you could use deparse instead of dput (the use cat or other functions to display the results

Re: [Rd] Pretty-printer for R data

2014-05-27 Thread Greg Snow
There are editors that are R aware and have some functionality along these lines (though I don't know of any command line type). Some to look at are the Emacs/ESS combination or Rstudio. On Tue, May 27, 2014 at 11:10 AM, Stavros Macrakis (Σταῦρος Μακράκης) macra...@alum.mit.edu wrote: Is there

Re: [Rd] Strange behaviour of the ':' operator

2014-04-27 Thread Greg Snow
From the help page ?':' we can read: Value ‘to’ will be included if it differs from ‘from’ by an integer up to a numeric fuzz of about ‘1e-7’. So it looks like it is the intended behavior. On Sun, Apr 27, 2014 at 5:38 AM, Hans W Borchers hwborch...@gmail.com wrote: Is the following

Re: [Rd] The case for freezing CRAN

2014-03-20 Thread Greg Snow
On Thu, Mar 20, 2014 at 7:32 AM, Dirk Eddelbuettel e...@debian.org wrote: [snip] (and some readers may recall the infamous Pentium bug of two decades ago). It was a Flaw not a Bug. At least I remember the Intel people making a big deal about that distinction. But I do remember the

Re: [Rd] Including R code from another package...

2013-10-03 Thread Greg Snow
If the package is on CRAN then the license should be a free one that would let you copy whatever you want from it. However it would be most polite to contact the original author first. I know that I have given permission for a couple of my functions to be included in other packages where it

Re: [Rd] Milestone: 4000 packages on CRAN

2012-08-24 Thread Greg Snow
On Fri, Aug 24, 2012 at 4:32 AM, S Ellison s.elli...@lgcgroup.com wrote: [snip] Anyone out there still think statistics are easy? There are plenty of people out there that still think statistics are easy, after all you can always stick a bunch of numbers into Excel and get all kinds of

Re: [Rd] how to make a true binary package?

2011-10-12 Thread Greg Snow
If you want to hide some code from accidental or casual sight then I have had some success with adding something like this to the .R file for a package (the petals function in TeachingDemos in this case): .onAttach - function(...) { petals - petals attr(petals,'source') - Don't Cheat!

Re: [Rd] default par

2011-07-26 Thread Greg Snow
For number 1, one option is to use the setHook function with the hook in plot.new. Using this you can create a function that will be called before every new plot is created, your function could then call par with the options that you want, this will set the parameters on all devices. However

Re: [Rd] Fwd: Understanding R's Environment concept

2011-07-18 Thread Greg Snow
Here is an attempt at the general concept without getting technical. How many people in the world answer to the name/title Dad? Yet based on context we can usually tell who someone is talking about when they use Dad. It is the same in programming, I may write a function which includes a

[Rd] tkrplot not working in R 2.13.0

2011-05-04 Thread Greg Snow
The tkrplot package is not working in version 2.13.0 for windows. I contacted the maintainer who unfortunately does not have easy access to a windows computer and says that it is working on the other platforms. I traced the problem down to the line in the .First.lib function: .Tcl(paste(load,

Re: [Rd] tkrplot not working in R 2.13.0

2011-05-04 Thread Greg Snow
-Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Wednesday, May 04, 2011 10:35 AM To: Greg Snow Cc: R Devel List Subject: Re: [Rd] tkrplot not working in R 2.13.0 What example are you trying? The code in ?trkplot works for me. However, it looks to me like

Re: [Rd] tkrplot not working in R 2.13.0

2011-05-04 Thread Greg Snow
, 2011 11:43 AM To: Greg Snow Cc: Prof Brian Ripley; R Devel List Subject: Re: [Rd] tkrplot not working in R 2.13.0 On May 4, 2011, at 19:26 , Greg Snow wrote: It looks like the spaces in the path is the problem, when I run the line below with shQuote then everything starts working

Re: [Rd] Wish R Core had a standard format (or generic function) for newdata objects

2011-04-28 Thread Greg Snow
Another way to see your plots is the TkPredict function in the TeachingDemos package. It will default the variables to their medians for numeric predictors and baseline level for factors, but then you can set all of those to something more meaningful one time using the controls, then cycle

Re: [Rd] Use keep.source for function in package with lazy loading

2011-04-18 Thread Greg Snow
that everything is doing what it should there. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Sunday, April 10, 2011 4:52 AM To: Greg Snow Cc

Re: [Rd] Use keep.source for function in package with lazy loading

2011-04-05 Thread Greg Snow
have to experiment some more. Thanks, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Monday, April 04, 2011 3:41 PM To: Greg Snow Cc: R

[Rd] Use keep.source for function in package with lazy loading

2011-04-04 Thread Greg Snow
I have a function in one of my packages that I would like to print using the original source rather than the deparse of the function. The package uses lazy loading and the help page for library (under keep.source) says that keep.source does not apply to packages that use lazy loading and that

Re: [Rd] Sweave: multiple graphic formats, e.g. win.metafile

2011-03-23 Thread Greg Snow
You might consider using odfWeave, then you can create a single document, save it as a word doc, and send it to collaborators where they can then cut and paste from the word doc to whatever they are using. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [Rd] Feature request: txtProgressBar with ability to write to arbitrary stream

2011-03-15 Thread Greg Snow
You could use winProgressBar (windows only) or TkProgressBar (tcltk package required) instead, then nothing is output to the console/standard out but you still have a visual of your progress. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

Re: [Rd] normality and equal variance testing

2011-01-24 Thread Greg Snow
Why do you want to test for normality and equal variances? If those are really a concern then you should use a method up front that is robust against those. Those tests are usually testing a hypothesis that is different from what you are actually interested in and generally have low power to

Re: [Rd] Wait for user input with readline()

2010-12-07 Thread Greg Snow
Part of the problem seems to be that R is set up to run in 1 of 2 modes (I may be over generalizing or over simplifying here), the modes are interactive where you type in a command, R processes it and gives results, you type in another command, etc. The other is Batch mode where everything is

Re: [Rd] Plotting an agnes tree with images instead of labels?

2010-11-18 Thread Greg Snow
You could use the my.symbols function in the TeachingDemos package to add the structures to the plot (once you create the plot without the default labels and find the positions to plot them at ). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [Rd] How do you make a formal feature request?

2010-08-24 Thread Greg Snow
I can claim some responsibility for 3 sets of functions that are in core R, well they are in packages, but then so is the plot function, but packages that are loaded automatically in a default installation of R. My piece of the responsibility is probably more the blame than credit (the credit

[Rd] Should mcnemar.test use as.factor instead of factor

2010-04-27 Thread Greg Snow
I am working with the mcnemar.test function and the help does not show a maintainer/author, but it is part of the stats package. My issue is that I want to use the test on 2 variables with possible values of 0:3, in one of the tests one of the variables does not have any 3's, so to make sure

Re: [Rd] R crashes when setWinProgressBar is give a numeric value for label argument

2010-02-11 Thread Greg Snow
(Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Thursday, February 11, 2010 11:05 AM To: Greg Snow Cc: r-devel Subject: Re: [Rd] R crashes when

[Rd] R crashes when setWinProgressBar is give a numeric value for label argument

2010-02-10 Thread Greg Snow
This problem can be seen by the following commands: pb - winProgressBar(max=1000, label='0') b - 1 setWinProgressBar(pb, b, label=b) This set of commands (on windows of course, XP in this case) causes R to crash. This is not strictly a bug since the documentation states that the label

Re: [Rd] boxplot: auto sizing for ylim variable

2009-12-02 Thread Greg Snow
I don't understand your question. Are you trying to create a boxplot or barplot (you mention both), what scaling is not happening automatically that you would like? Can you give a simple example of what you have tried, what results you are seeing and what results you would like to see

Re: [Rd] inconsistent behavior for logical vectors when using apply ( TRUE)

2009-11-04 Thread Greg Snow
The apply function was meant to work on matrices and arrays, when you use it on a data frame, the frame is first converted to a matrix. Since your data frame has columns of different modes, the logical column is converted to character and the matrix is of the single mode character. That is

Re: [Rd] Polymorphism of predict

2009-08-19 Thread Greg Snow
Instead of using smooth.spline, use lm with spline terms, e.g.: library(splines) sp.fit - lm(y~bs(x,4)) Now both use predict.lm for the predictions and all will be consistent. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [Rd] Accuracy (PR#13867)

2009-08-04 Thread Greg Snow
What research into this problem did you do that failed to turn up FAQ 7.31? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-

Re: [Rd] Accuracy (PR#13867)

2009-08-04 Thread Greg . Snow
What research into this problem did you do that failed to turn up FAQ 7.31? --=20 Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-

Re: [Rd] Recommendations for a quick UI.

2009-06-02 Thread Greg Snow
Some possibilities: The Rcmdr package is a very good example of a GUI built using Tk (it does not hide the R program, but lets you do analyses using menus and dialogs). Rcmdr also has a plug-in mechanism to write extensions to it, depending on what you want to do, writing a simple extension

Re: [Rd] License status of CRAN packages

2009-04-23 Thread Greg Snow
I don't know about the legal definitions of all, but a few years back the British Medical Journal had a filler article that looked at some surveys of what people thought different words meant (you can get at the filler by going to http://www.bmj.com/cgi/content/full/333/7565/442 and downloading

Re: [Rd] quantile(), IQR() and median() for factors

2009-03-06 Thread Greg Snow
I like the idea of median and friends working on ordered factors. Just a couple of thoughts on possible implementations. Adding extra checks and functionality will slow down the function. For a single evaluation on a given dataset this slowdown will not be noticeable, but inside of a

Re: [Rd] quantile(), IQR() and median() for factors

2009-03-06 Thread Greg Snow
, March 06, 2009 2:08 PM To: Prof Brian Ripley Cc: Greg Snow; R-devel Subject: Re: [Rd] quantile(), IQR() and median() for factors Dear Greg, thank you for your comments, as Prof. Ripley pointed out, in the case of even sample size the median is not unique and is formed by the two central

Re: [Rd] bug (PR#13570)

2009-03-05 Thread Greg Snow
I see the same problem on Windows XP. But if I run loess with surface='direct' then the results are correct. So it looks like the problem comes from the smoothing/interpolating, not the main loess algorithm. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [Rd] getGraphicsEvent in an example

2009-02-17 Thread Greg Snow
Just wrap the example in either \dontrun{} or if(interactive()){ } That way that example will be skipped when the automatic tests are done, but will still be available for a reader to run by copy/paste or the examples function (2nd case above). This has worked for me, examples using these are

Re: [Rd] [R] Is abline misbehaving?

2009-02-05 Thread Greg Snow
Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Thursday, February 05, 2009 6:42 AM To: Greg Snow Cc: Jim Lemon; r-devel@r-project.org Subject: Re: [R] Is abline misbehaving? [Moved to R-devel, where it probably should have started and it is getting to C-level functions now.] abline

Re: [Rd] open-ended plot limits?

2009-02-05 Thread Greg Snow
I use range( 0, y ) rather than c(0, max(y)), that way if there are any y values less than 0, the limits still include them (and it is slightly shorter :-). This also extends to cases where you may know that you will be adding additional data using points or lines, so you can do ylim=range(0,

Re: [Rd] open-ended plot limits?

2009-02-05 Thread Greg Snow
To: Greg Snow; marc_schwa...@comcast.net; ted.hard...@manchester.ac.uk Cc: R-Devel Subject: RE: [Rd] open-ended plot limits? -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Greg Snow Sent: Thursday, February 05, 2009 1:15

Re: [Rd] gregexpr - match overlap mishandled (PR#13391)

2008-12-12 Thread Greg Snow
Where do you get should and expect from? All the regular expression tools that I am familiar with only match non-overlapping patterns unless you do extra to specify otherwise. One of the standard references for regular expressions if you really want to understand what is going on is Mastering

Re: [Rd] gregexpr - match overlap mishandled (PR#13391)

2008-12-12 Thread Greg . Snow
Where do you get should and expect from? All the regular expression to= ols that I am familiar with only match non-overlapping patterns unless you = do extra to specify otherwise. One of the standard references for regular = expressions if you really want to understand what is going on is

Re: [Rd] using yscrollcommand in tkcanvas crashes R (PR#13231)

2008-10-30 Thread Greg Snow
I don't know if this is the case here or not, but putting in scrollbars and scrolling can be a bit tricky. It usually works best to create the canvas without a scroll command, then create the scrollbar(s), then use tkconfig to go back and add the scroll command to the canvas after the

Re: [Rd] using yscrollcommand in tkcanvas crashes R (PR#13231)

2008-10-30 Thread Greg . Snow
I don't know if this is the case here or not, but putting in scrollbars and= scrolling can be a bit tricky. It usually works best to create the canvas= without a scroll command, then create the scrollbar(s), then use tkconfig = to go back and add the scroll command to the canvas after the

[Rd] writting null (\000 or ^@) to an external text file without the new warning

2008-10-28 Thread Greg Snow
I have some functions that write an external text file for postprocessing by another program. Some instructions to the other program need to be indicated by null values (\000 or ^@). The function currently uses code like: writeChar(rawToChar(as.raw(0)), con) where con is a connection to the

Re: [Rd] writting null (\000 or ^@) to an external text file without the new warning

2008-10-28 Thread Greg Snow
, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 -Original Message- From: Simon Urbanek [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2008 3:20 PM To: Greg Snow Cc: R-devel@r-project.org Subject: Re: [Rd] writting null

Re: [Rd] RFC: Kerning, postscript() and pdf()

2008-10-16 Thread Greg Snow
Prof. Ripley, I am sure I speak for many others when I say Thank You for this and all the other great work that you do. R is already capable of producing high quality graphics, this will just make them better. Kerning is one of those things that generally don't get noticed unless done

Re: [Rd] Cross-platform function availability

2008-09-15 Thread Greg Snow
I think it is a little more complex than just installing and checking. tkProgressBar uses tcltk which works on the major platforms (unix/linux, mac, windows), but only if tk is installed and available. I believe that on mac tk is only available if X11 is used and if I remember correctly, if R

Re: [Rd] HOW TO AVOID LOOPS

2008-04-14 Thread Greg Snow
I would be interested to see how the following approach compares to the other suggestions: x - c(0,0,1,0,1,1,1,0,0,1,1,0,1,0,1,1,1,1,1,1) test - c(0,0,1,0,1,2,3,0,0,1,2,0,1,0,1,2,3,4,5,6) out - Reduce( function(x,y) x*y + y, x, accumulate=TRUE ) all.equal(out,test) [1] TRUE For the second

Re: [Rd] Clipping using par(plt=..., xpd=FALSE) inconsistencies

2008-03-03 Thread Greg Snow
, 2008 2:06 PM To: Greg Snow Cc: r-devel@r-project.org Subject: Re: [Rd] Clipping using par(plt=..., xpd=FALSE) inconsistencies The following works in R-devel x - rnorm(1000) hist(x, xlim=c(-4,4)) usr - par(usr) clip(usr[1], -2, usr[3], usr[4]) hist(x, col

[Rd] Clipping using par(plt=..., xpd=FALSE) inconsistencies

2008-02-22 Thread Greg Snow
Here is a demonstration of behaviour that is probably an optimization by someone far smarter than me that did not anticipate anyone wanting to do this, but for my purposes it looks more like a bug than a feature. I have tested this with R2.6.2 on Windows, no additional packages loaded (beyond the

Re: [Rd] Assigning a sub-matrix from a data frame to a regular matrixcauses strange behaviour (version 2.6.1) (PR#10799)

2008-02-21 Thread Greg Snow
Part of the problem is that you are not adjusting for the fact that you are smarter than the computer. Realize that the way you are doing the assignment requires a lot of different things behind the scenes and remember that data frames are basically lists with some extra attributes and matricies

Re: [Rd] Assigning a sub-matrix from a data frame to a regular (PR#10822)

2008-02-21 Thread Greg . Snow
Part of the problem is that you are not adjusting for the fact that you are smarter than the computer. Realize that the way you are doing the assignment requires a lot of different things behind the scenes and remember that data frames are basically lists with some extra attributes and matricies

Re: [Rd] Vector binding on harddisk

2008-02-14 Thread Greg Snow
You may want to look at the SQLiteDF package, this allows you to put your data into an SQLite database and treat that like a normal vector or data frame inside of R. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801)

Re: [Rd] 0.450.45 = TRUE (PR#10744)

2008-02-12 Thread Greg Snow
I don't think that we need a full discussion in the Introduction, but how about early on it shows an example of 2 floating point numbers not being equal (and one of the work arounds like all.equal) along with a note (bright, bold, etc.) that says that if the reader did not expect the FALSE result

Re: [Rd] gregexpr (PR#9965)

2007-10-11 Thread Greg . Snow
If you want all the matches (including overlaps) then you could try one of these: gregexpr((?=3Dabab),ababab,perl=3DTRUE) [[1]] [1] 1 3 attr(,match.length) [1] 0 0 gregexpr(ab(?=3Dab),ababab,perl=3DTRUE) [[1]] [1] 1 3 attr(,match.length) [1] 2 2 The book Mastering Regular Expressions by

Re: [Rd] gregexpr (PR#9965)

2007-10-10 Thread Greg Snow
If you want all the matches (including overlaps) then you could try one of these: gregexpr((?=abab),ababab,perl=TRUE) [[1]] [1] 1 3 attr(,match.length) [1] 0 0 gregexpr(ab(?=ab),ababab,perl=TRUE) [[1]] [1] 1 3 attr(,match.length) [1] 2 2 The book Mastering Regular Expressions by Jeffrey

Re: [Rd] R-Server remotecontrolled via browser-GUI

2007-09-28 Thread Greg Snow
Have you read section 4 of the FAQ? If not, that would be a good place to start. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

Re: [Rd] Compiling R for the Sony Playstation 3?

2007-08-06 Thread Greg Snow
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Barry Rowlingson Sent: Friday, August 03, 2007 10:56 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; Douglas Bates; R-devel List Subject: Re: [Rd] Compiling R for the Sony Playstation 3? [snip]

Re: [Rd] loess prediction algorithm

2007-07-26 Thread Greg Snow
The loess.demo function in the TeachingDemos package may help you to understand better what is happening (both running the demo and looking at the code). One common reason why predictions from the loess function and hand computed predictions don't match is because the loess function does an

Re: [Rd] cor() and cor.test() (PR#9781)

2007-07-05 Thread Greg Snow
The cor function does not know how to look inside of data frames (unless you give it the entire data frame as the only argument). If Pollution and Wet.days are columns of the data frame named Pollution (which I infer from your problem statement below) then you can do things like:

Re: [Rd] possible bug in 'scan'

2007-06-26 Thread Greg Snow
The what argument looks at what the elements are, not the word they say. Try this: tmp - scan(C:/temp.csv, what=list(,0), sep=,) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111

Re: [Rd] extracting rows from a data frame by looping over the row names: performance issues

2007-03-05 Thread Greg Snow
Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: Herve Pages [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 7:04 PM To: Greg Snow Cc: r-devel@r-project.org Subject: Re: [Rd] extracting rows from a data frame

Re: [Rd] extracting rows from a data frame by looping over the row names: performance issues

2007-03-02 Thread Greg Snow
Your 2 examples have 2 differences and they are therefore confounded in their effects. What are your results for: system.time(for (i in 1:100) {row - dat[i, ] }) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111

Re: [Rd] Using TCP/IP sockets in R

2006-08-15 Thread Greg Snow
Have you looked at the nws package (and the nws server from the same group), they include python to do parallel computing and may give you the examples you need. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original

Re: [Rd] [R] how to extract the column name or value from the numerical value of the matrix

2005-09-19 Thread Greg Snow
look at ?col and ?row. One way to use them is: col(A)[A==11] row(A)[A==14] hope this helps, Greg Snow, Ph.D. Statistical Data Center, LDS Hospital Intermountain Health Care [EMAIL PROTECTED] (801) 408-8111 shanmuha boopathy [EMAIL PROTECTED] 09/19/05 01:30PM Dear sir, i have a matrix like