[R] /usr/local/lib/R/site-library is not writable

2021-04-07 Thread Gene Leynes
Hello R Community, I've been using R for a long time, and this is a question that still makes me think twice every single time I install R, which is more and more often . The first search hit is this StackOverflow question: https://stackoverflow.com/questions/32540919/library-is-not-writable The

Re: [R] R Example scripts

2014-04-22 Thread Gene Leynes
/home/bsm-1 On Sat, Apr 19, 2014 at 6:12 AM, Duncan Murdoch wrote: > On 18/04/2014, 6:07 PM, Gene Leynes wrote: >> >> A few years ago R changed the way help was handled so that the HTML >> files are no longer available in the library directory. Around that >> tim

[R] R Example scripts

2014-04-18 Thread Gene Leynes
A few years ago R changed the way help was handled so that the HTML files are no longer available in the library directory. Around that time the R example files that used to be in some of the libraries also vanished. I'm wondering where the "r-ex" folder went. Is it totally unsupported and gone?

Re: [R] NextMethod in boxcox

2014-02-15 Thread Gene Leynes
How can I see the code for boxcox.default? > library(MASS) > boxcox.default Error: object 'boxcox.default' not found > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] NextMethod in boxcox

2014-02-14 Thread Gene Leynes
I found some good explanations of what the Box Cox transform for anyone who happens upon this thread while searching for boxcox details: This is the best explanation I found of what how the Box Cox transformation is calculated. It explains why QR decomposition is used, has nice code examples that

Re: [R] NextMethod in boxcox

2014-02-14 Thread Gene Leynes
ls that provide greater detail. > > Cheers, > Bert > > Bert Gunter > Genentech Nonclinical Biostatistics > (650) 467-7374 > > "Data is not information. Information is not knowledge. And knowledge > is certainly not wisdom." > H. Gilbert Welch > > >

Re: [R] NextMethod in boxcox

2014-02-14 Thread Gene Leynes
unction compute the boxcox transformation? On Thu, Feb 13, 2014 at 4:59 PM, Bert Gunter wrote: > Have you tried: > > ?NextMethod > > ? > > -- Bert > > Bert Gunter > Genentech Nonclinical Biostatistics > (650) 467-7374 > > "Data is not informatio

[R] NextMethod in boxcox

2014-02-13 Thread Gene Leynes
I was trying to understand the boxcox function in MASS to get a better understanding of where and how the log-Likelihood values are calculated. By using "debug(boxcox)" I found this code while running the examples: > m <- length(lambda) > object <- lm(object, y = TRUE, qr = TRUE, ...) >

Re: [R] Failure to install RSer

2013-06-18 Thread Gene Leynes
2013 at 5:27 PM, Ista Zahn wrote: > On Mon, Jun 17, 2013 at 6:11 PM, Gene Leynes wrote: > > > > I should have called this "failure to install several packages" > > > > Here is the list of libraries that I can't install in 3.0.1 that I could >

Re: [R] Failure to install RSer

2013-06-17 Thread Gene Leynes
ph" [5] "rCharts" "RCurl" "Rgraphviz" "Rserve" On Mon, Jun 17, 2013 at 5:02 PM, Gene Leynes wrote: > Hello, > > I just upgraded to 3.0.1 and a bunch of packages won't install, including > Rserve and RCurl > > A

[R] Failure to install RSer

2013-06-17 Thread Gene Leynes
Hello, I just upgraded to 3.0.1 and a bunch of packages won't install, including Rserve and RCurl Any hints on why? Thanks > install.packages('Rserve') --- Please select a CRAN mirror for use in this session --- trying URL 'http://cran.case.edu/bin/windows/contrib/3.0/Rserve_0.6-8.1.zip' Conten

Re: [R] Putting an array from excel into R Studio

2013-02-11 Thread Gene Leynes
This doesn't answer your question, but you may find some of my functions useful: https://github.com/geneorama/geneorama/blob/master/R/clipper.R https://github.com/geneorama/geneorama/blob/master/R/clipped.R You can quickly get stuff from Excel using the clipboard using clipped(). I also added so

Re: [R] Recursive function calls

2012-08-03 Thread Gene Leynes
, x) trimmer = function(x){ if(is.list(x)){ rapply(x, trim, how='replace') }else{ trim(x) } } tempobj = ' many spaces ' tempvec = c(tempobj, tempobj) templist = list(tempvec, tempvec) tempdf = data.frame(x = tempvec, y = tempvec) trimmer(tempobj) trimmer(tempvec) tr

Re: [R] Recursive function calls

2012-08-03 Thread Gene Leynes
; trim2(tempdf) > > # Extra test > templistlist <- list(templist, list(tempobj, tempdf)) > trim2(templistlist) > > Note, however, that the df is not returned as a df: > > > class(trim2(tempdf)) > [1] "matrix" > > Hope this helps, > > Rui Barrad

Re: [R] Recursive function calls

2012-08-03 Thread Gene Leynes
x27;s the only way (which I know it isn't) I'd rather use the one-off methods that are less efficient. I do sincerely appreciate your response, and I'm quite jealous of your URL gene.com. When I was searching for a URL for my personal website I wanted something with my name "gene

[R] Recursive function calls

2012-08-03 Thread Gene Leynes
' tempvec = c(tempobj, tempobj) templist = list(tempvec, tempvec) tempdf = data.frame(x = tempvec, y = tempvec) trim(tempobj) trim(tempvec) trim(templist) trim(tempdf) Thank you, Gene Leynes _ *Data Scientist* *Mobile: 312-498-77

Re: [R] Zoo panel function

2012-07-31 Thread Gene Leynes
27;t think would work were ok, and other things that seemed correct would threw errors. If you have some insight I would like to hear it, but this isn't that important because there are obviously other approaches for making the same / similar output. Thank you, Gene Leynes

Re: [R] Ubuntu installation

2012-07-31 Thread Gene Leynes
Hope this helps someone. Thank you, Gene Leynes _ *Data Scientist* *http://www.linkedin.com/in/geneleynes * <http://goog_598053156>*http://geneorama.com/ <http://geneorama.com/%20>* On Tue, Jul 31, 2012 at 12:48 AM, Gene Leynes wr

[R] Ubuntu installation

2012-07-31 Thread Gene Leynes
base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.14.1 > Thank you, Gene Leynes _ *Data Scientist* *http://www.linkedin.com/in/geneleynes * <http://goog_5

[R] Zoo panel function

2012-07-29 Thread Gene Leynes
l=mypanel_v2, MY_COLOR = mycol) Thank you, Gene Leynes _ *Data Scientist* *http://www.linkedin.com/in/geneleynes * <http://goog_598053156>*http://geneorama.com/ <http://geneorama.com/%20>* [[alternative HTML version deleted]] __

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-16 Thread Gene Leynes
until last week, what as.numeric(POSIXct) > would give). > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Gene Ley

[R] formatting sub-second intervals

2012-04-16 Thread Gene Leynes
I would like to suggest that there is some documentation missing from strptime. There appears to be a way to show second decimals by using "%OS4" (change the number to get more or less decimals), but it's not mentioned anywhere that I can find. After a long time searching and experimenting I fina

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-16 Thread Gene Leynes
changing the global eps. Also, I love the "" tags. I wish that conceptual structure was a common convention in human language. Thanks, Gene On Sat, Apr 14, 2012 at 2:45 PM, peter dalgaard wrote: > > On Apr 14, 2012, at 14:40 , Berend Hasselman wrote: > > > > > On

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-14 Thread Gene Leynes
ink I might just use this function for now to approximate the simple slope function in excel: slope = function(x,y) { ret = sum((x-mean(x))*(y-mean(y)))/sum((x-mean(x))^2) return(ret) } On Sat, Apr 14, 2012 at 7:40 AM, Berend Hasselman wrote: > > On 13-04-2012, at 22:20, Gene L

[R] Seemingly simple "lm" giving unexpected results

2012-04-13 Thread Gene Leynes
I can't figure out why this is returning an NA for the slope in one case, but not in the other. I can tell that R thinks the first case is singular, but why isn't the second? ## Define X and Y ## There are two versions of x ## 1) "as is" ## 2) shifted to start at 0 y = c(58, 57, 57, 279,

Re: [R] read.table performance

2011-12-08 Thread Gene Leynes
Now this is interesting: Here's a list of how long it took to read the same file in various versions of R: R version 2.10.1 (2009-12-14) 3.97 R version 2.12.0 (2010-10-15)24.53 R version 2.13.0 (2011-04-13)24.48 R version 2.14.0 (2011-10-31) 3.75 I think that the even numbered re

Re: [R] read.table performance

2011-12-08 Thread Gene Leynes
t;> head(names(dat)) > > [1] "X..Hydrogen" "Helium" "Lithium" "Beryllium" "Boron" > > [6] "Carbon" > >> tail(names(dat)) > > [1] "Sulfur.32""Chlorine.32" "Argon.32

Re: [R] read.table performance

2011-12-07 Thread Gene Leynes
ene, are you by any chance storing the file in a heavily virus-scanned > system directory? > > -pd > >> Michael >> >> 2011/12/7 Gene Leynes : >>> Peter, >>> >>> You're quite right; it's nearly impossible to make progress without a &g

Re: [R] RSPython installation

2011-12-07 Thread Gene Leynes
Dec 7, 2011 at 11:28 AM, Gene Leynes wrote: > Does anyone know if Is there a way to manually install RSPython? > > I get this error when I try to run the script from my DOS prompt. > > > V:\>R CMD INSTALL -c C:/Users/gene.leynes/Downloads/RSPython_0.7-1.tar.gz > * in

Re: [R] select integer intervals from a integer space

2011-12-07 Thread Gene Leynes
Possibly not the absolutely most efficient answer, but this is probably an answer nonetheless (David, hope I'm not encouraging bad behavior by replying.) isp <- data.frame(begin=c(1,5,6,15,31,51,102), end=c(7,9,13,21,49,52,109)) isp ints = apply(isp, 1, function(x)seq(x[1],x[2])) ints ints = do.ca

Re: [R] curve fitted ... how to retreive data

2011-12-07 Thread Gene Leynes
For the components: result = predict(b, type="terms") For the total fit: result = predict(b) result = b$fitted.values On Wed, Dec 7, 2011 at 3:24 AM, Mintewab Bezabih < mintewab.beza...@economics.gu.se> wrote: > Dear R users, > > I have now managed to fit the curve using the thin plate spline a

[R] RSPython installation

2011-12-07 Thread Gene Leynes
Does anyone know if Is there a way to manually install RSPython? I get this error when I try to run the script from my DOS prompt. V:\>R CMD INSTALL -c C:/Users/gene.leynes/Downloads/RSPython_0.7-1.tar.gz * installing to library 'C:/Users/gene.leynes/Documents/R/win-library/2.13' * installing *s

Re: [R] read.table performance

2011-12-06 Thread Gene Leynes
as.is=TRUE, colClasses = c(rep(character,4), > rep(NULL,3696)). > > hopefully someone else will say something that does the trick. it seems > odd to me as far as the > difference in timings ? good luck. > > > > > > On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes

Re: [R] To Try or to TryCatch, I have tried to long

2011-12-06 Thread Gene Leynes
n error pop up? Any ideas? > > Cheers > > -- > *From:* gley...@gmail.com [mailto:gley...@gmail.com] *On Behalf Of *Gene > Leynes > *Sent:* Tuesday, December 06, 2011 10:27 AM > *To:* ROLL Josh F > *Cc:* r-help@r-project.org > *Subject:* Re

[R] read.table performance

2011-12-06 Thread Gene Leynes
** Disclaimer: I'm looking for general suggestions ** I'm sorry, but can't send out the file I'm using, so there is no reproducible example. I'm using read.table and it's taking over 30 seconds to read a tiny file. The strange thing is that it takes roughly the same amount of time if the file is 1

Re: [R] To Try or to TryCatch, I have tried to long

2011-12-06 Thread Gene Leynes
I think the problem is that it's only a warning and not an error. result_<-list() for(i in 1:10){ if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ #If sqrt fails cat('fail',i,'\n') result_[[i]]<-0 } else { #If sqrt succeeds cat('succeed',i,'\n') result_[[i]]

Re: [R] Upgrade R?

2011-11-14 Thread Gene Leynes
I have had similar problems. I have several installations of R and now I have no control over which one opens when I try opening a RData file. The RGUI is registered more than once, but they all have the exact same appearance in the "choose programs" menu. It's become particularly annoying now t

[R] R Startup options (MDI and SDI)

2011-11-11 Thread Gene Leynes
Here's my setup: - I'm on a Windows machine (I don't have full admin rights) - I have a folder with an *.RData file and an .RProfile file - I want the user to be able to start R by double clicking on the *.RData file Can I specify the application start up options (like --no-save --md

Re: [R] replace double backslash with singel backslash

2011-11-04 Thread Gene Leynes
I think that people are afraid to say "You can't do that in R"... But I think the real answer is: you can't do that in R. Although, it is helpful to understand Jeff's reply. I hadn't fully realized why this particular problem occurs before reading that. It's odd to me that // and / are both stor

Re: [R] Testing for arguments in a function

2011-09-26 Thread Gene Leynes
Alan and Duncan, or test them explicitly with missing(). If you want to do this > automatically, then you shouldn't be using substrings and deparse, you > should work at the language level. But I don't see the reason you want to > do this... > Absolutely. That wasn't the way I wanted to do it,

Re: [R] Testing for arguments in a function

2011-09-26 Thread Gene Leynes
missing subsets. On Mon, Sep 26, 2011 at 4:33 PM, Gene Leynes wrote: > Alan and Duncan, > > or test them explicitly with missing(). If you want to do this >> automatically, then you shouldn't be using substrings and deparse, you >> should work at the language l

[R] Testing for arguments in a function

2011-09-26 Thread Gene Leynes
I don't understand how this function can subset by i when i is missing ## My function: myfun = function(vec, i){ ret = vec[i] ret } ## My data: i = 10 vec = 1:100 ## Expected input and behavior: myfun(vec, i) ## Missing an argument, but error is not caught! ## How is subsetting even

[R] Invisible doesn't exit function?

2011-09-19 Thread Gene Leynes
I thought that invisible works like return() However, it appears that it doesn't exit a function. Is it supposed to work this way? funInvisible = function(){ invisible(10) cat('I was not expecting this to print\n') cat('because it occurs after the invisible return\n') } funInvisible(

Re: [R] Searching the console

2011-09-08 Thread Gene Leynes
searchhist = function(pattern){ histfile = tempfile() savehistory(histfile) myHist = readLines(file(histfile)) ret = myHist[grep(pattern, myHist)] return(ret) } searchhist('data') searchhist('^lm') searchhist('hist') On Thu, Sep 8, 2011 at 12:03 AM, andrewH wrote: > Is there

Re: [R] Can't load workspaces

2011-09-08 Thread Gene Leynes
Are you doing something in your profile.site file or loading a package that masks "load"? It seems that you're deparsing (or parsing, I can never remember which is which) the literal results of the load function. Does it work if you do this? save(a, file='a.RData') On Thu, Sep 8, 2011 at 12:24

Re: [R] Possible to access a USB volume by name in windows

2011-09-07 Thread Gene Leynes
_NAME" > myset("FLASH_NAME") > ## set WD so some subdirectory > myset("FLASH_NAME", "path/to/something") > > At least on my system, this takes awhile to run. It iterates through > all the volumes [A-Z], and there will probably be quite a fe

Re: [R] heatmap

2011-09-06 Thread Gene Leynes
I wrote this function (borrowing heavily from an example from Longhow Lam) heatplot = function(x,y,z,bgcol="#777044",coltype='heat', ccex = 1.5, circles=TRUE, ...){ #browser() layout(matrix(c(1, 2, 3), nc=3), widths=c(7, 1, .5)) ## create the scatterplot withdifferent color

[R] Possible to access a USB volume by name in windows

2011-09-06 Thread Gene Leynes
On the Mac it's pretty easy to get to a USB drive by name. For example the following command works if you have a USB drive named "MYUSB" setwd('/Volumes/MYUSB') Is there a way to do the same thing in Windows (without knowing the drive letter)? Thanks! [[alternative HTML version deleted

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
. That > nice police officer over there is telling us: "Nothing to see here folks, > move on; please stop blocking the sidewalk." > > > >> >> Obviously this is hard for anyone to troubleshoot if you can't reproduce >> it. I get the same error in R ver

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
2001-01-05 2001-01-06 > 1 2 3 0 5 > > (Those actually line up correctly on my machine..) > > Michael Weylandt > > On Mon, Aug 29, 2011 at 2:45 PM, Gene Leynes wrote: > >> Why doesn't this work? >> >> x = zoo

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
or in R versions 12.0 and 13.0 (although I don't get the "warning zoo was built under R 13.1" warning when I use zoo in R 12.0) On Mon, Aug 29, 2011 at 2:07 PM, Gene Leynes wrote: > Michael, > > By the way, although I replied to David's email, I was responding to you

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
as.Date('2001-01-05')] 2001-01-05 4 > x[as.Date('2001-01-05')] = 0 > x Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent > > Thank you for any insight On Mon, Aug 29, 2011 at 1:53 PM, David Winsemius wrote:

[R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
Why doesn't this work? x = zoo(1:5, as.Date('2001-01-01')+1:5) x[as.Date('2001-01-05')] x[as.Date('2001-01-05')] = 0 x I think this is especially bad because it doesn't cause an error. It lets you do something to x, but then you can't see x again to see what it did. [[alternative HTML

[R] GAM Prediction

2011-08-10 Thread Gene Leynes
I'm looking for the best way to do the following: run a set of GAM models, and then make predictions with new data. My problem is the size of the gam model object, I would like to strip it down to the bare minimum of information needed to apply the model to new data. For example, if this wer

Re: [R] General indexing in multidimensional arrays

2011-08-04 Thread Gene Leynes
at the location array lines up in dimension > order, > >>> but other than that seems to work pretty well. If you want, it > shouldn't > >>> be > >>> hard to change it to take in a set of dimensions to arrange Location > >>> along. > >>

Re: [R] General indexing in multidimensional arrays

2011-08-04 Thread Gene Leynes
;> is.null(Insert) option that returns the desired subset of values. I >>> haven't >>> tested it completely, but for a few sample inputs, it seems be do as >>> desired. >>> >>> Michael >>> >>> >>> On Wed, Aug 3, 201

Re: [R] General indexing in multidimensional arrays

2011-08-04 Thread Gene Leynes
values. I >>> haven't >>> tested it completely, but for a few sample inputs, it seems be do as >>> desired. >>> >>> Michael >>> >>> >>> On Wed, Aug 3, 2011 at 5:00 PM, Jannis wrote: >>> >>> Thanks for

Re: [R] General indexing in multidimensional arrays

2011-08-01 Thread Gene Leynes
What do you think about this? apply(data, 3, '[', indices) On Mon, Aug 1, 2011 at 4:38 AM, Jannis wrote: > Dear R community, > > > I have a general question regarding indexing in multidiemensional arrays. > > Imagine I have a three dimensional array and I only want to extract on > vector along

Re: [R] Plotting question

2011-08-01 Thread Gene Leynes
plot(1:10, pch=letters[1:10]) On Mon, Aug 1, 2011 at 4:44 AM, Andrew McCulloch wrote: > Hi, > > I use R to draw my graphs. I have 100 points on a simple xy-plot. The > points are > distinguished by a third variable which is categorical with 10 levels. I > have > been plotting x against y and usin

Re: [R] Animated gif or something similar in R?

2011-07-29 Thread Gene Leynes
I wasn't at my normal computer yesterday, so I didn't run the example. I thought "rgl" was one of those color palette generator packages. So, my suggestion of using animation was completely off base (oops). But I did notice two other things: 1) your color column changes from a factor to a charac

Re: [R] Animated gif or something similar in R?

2011-07-28 Thread Gene Leynes
It seems like you have two questions, one about color rendering, and another about making animations. For the second question : I've found the animation package useful in similar situations, where I want to share results with non-R users who want a static visualization. By using animation you ca

Re: [R] apply is making me crazy...

2011-07-28 Thread Gene Leynes
ing it would be a disaster. On Thu, Jul 28, 2011 at 2:45 PM, David Winsemius wrote: > > On Jul 28, 2011, at 3:13 PM, Gene Leynes wrote: > > Very clever (as usual)… It works, but since I wanted to switch the rows >> and columns, which would require this: >> answer.sl

Re: [R] apply is making me crazy...

2011-07-28 Thread Gene Leynes
:3, function(x) matrix(rnorm(10 * x), ncol = x)) > > csfun <- function(m) { >if(ncol(m) == 1L) {return(m)} else { >t(as.matrix(apply(m, 1, cumsum))) > } > } > > lapply(exampGood, csfun) > lapply(exampBad, csfun) > > HTH, > Dennis > > On Wed, Ju

Re: [R] apply is making me crazy...

2011-07-28 Thread Gene Leynes
a drop=TRUE option in apply! Thanks again, Gene On Thu, Jul 28, 2011 at 12:05 PM, David Winsemius wrote: > > On Jul 28, 2011, at 12:31 PM, Gene Leynes wrote: > > (As I mentioned in my other reply to Dennis, I think I'll stick with for >> loops, but I wanted to respond.

Re: [R] apply is making me crazy...

2011-07-28 Thread Gene Leynes
nsion dim(X)[MARGIN] otherwise. If nis 0, the result has length 0 but not necessarily the ‘correct’ dimension.” I just wish that it had an option to do return an array of dimension c(n, dim(X)[MARGIN]) if n >= 1 On Wed, Jul 27, 2011 at 8:25 PM, David Winsemius wrote: > > On Jul 2

Re: [R] apply is making me crazy...

2011-07-27 Thread Gene Leynes
et back to 1000 rows LastColumn = ncol(mat) print(mat[2,LastColumn]) } On Wed, Jul 27, 2011 at 5:45 PM, David Winsemius wrote: > > On Jul 27, 2011, at 6:22 PM, Gene Leynes wrote: > > I have tried a lot of ways around this, but I can't find a way to make >> ap

Re: [R] for loop help

2011-07-27 Thread Gene Leynes
I'm not sure what you're doing... but here are some tips about the parts I can understand. 1) you don't need to use "which" as much. This works fine: stnID <- stnid[!duplicated(stnid)] 2) "which" works within a for loop 3) Do you realize that "stnID" is shorter after you removed duplicates

Re: [R] ?plot: Add an example on how to plot functions to the help of `plot`.

2011-07-27 Thread Gene Leynes
Paul, I agree completely. I didn't come at this with a programming background, and I never noticed the other plot links, or understood their importance. The "plot" help page was one of the first help pages I ever looked at and I remember that It was totally confusing. In fact, help pages like th

[R] apply is making me crazy...

2011-07-27 Thread Gene Leynes
I have tried a lot of ways around this, but I can't find a way to make apply work in a generalized way because it causes a failure whenever reduces the dimensions of its output. The following example is easier to understand than the question. I wish it had a "drop=TRUE/FALSE" option like the "["

Re: [R] Can you save an installed library to an .RData file?

2011-07-21 Thread Gene Leynes
Duncan, Makes perfect sense, thank you very much. Gene On Thu, Jul 21, 2011 at 10:46 AM, Duncan Murdoch wrote: > On 21/07/2011 11:37 AM, Gene Leynes wrote: > >> It occurred to me that it would be nice to be able to save a library that >> I >> have installed an loaded in

[R] Can you save an installed library to an .RData file?

2011-07-21 Thread Gene Leynes
It occurred to me that it would be nice to be able to save a library that I have installed an loaded into my workspace for easy sharing. I suppose it might not work if someone's on a different version of R, but usually since the library is just a collection of functions, it seems plausible that yo

[R] Tom Short's R cheat sheet

2011-07-08 Thread Gene Leynes
I noticed that there is a newer version of Tom Short's "cheat sheet" than the version currently posted on CRAN. Personally I like the newer version, but maybe keeping the old version is deliberate. Anyway, I was wondering if there's someone that I can notify that can update the content. New vers

Re: [R] panel.first problem when plotting with formula

2011-05-25 Thread Gene Leynes
David, Peter (and others), If you're interested, I submitted this as a bug, and was informed of the error of my ways by Professor Ripley * His informative reply is copied below. * The short answer is that panel.first is not a documented function of "plot.formula", which is called by the generic "

Re: [R] panel.first problem when plotting with formula

2011-05-24 Thread Gene Leynes
this level of functionality does not exist. However, if it did, it would probably never be fixed... and you could substitute "Excel" with "Any commercial software". Gene On Tue, May 24, 2011 at 3:13 AM, Peter Ehlers wrote: > On 2011-05-23 16:54, Gene Leynes wrote: &g

[R] panel.first problem when plotting with formula

2011-05-23 Thread Gene Leynes
I wrote a little function called bgfun that adds gridlines and a background, but it's not working with I plot using the formula. I have some theories on what's happening, but even if my theory is right, I don't know how to fix it. Someone have a straightforward silver bullet? Thank you, Gene

Re: [R] Using $ accessor in GAM formula

2011-05-10 Thread Gene Leynes
t; model that people actually use, I do use the formulation that you recommend. Thank you though. I believe that syntax makes a huge difference in readability and long term error reduction. Gene On Fri, May 6, 2011 at 12:18 PM, Gavin Simpson wrote: > On Fri, 2011-05-06 at 11:20 -0500, Gene

Re: [R] Using $ accessor in GAM formula

2011-05-06 Thread Gene Leynes
Hmmm After reading that email four times, I think I see what you mean. Checking for variables within particular scopes is probably one of the most challenging things in R, and I would guess in other languages too. In R it's compounded by situations when you're writing a function to accept va

[R] Using $ accessor in GAM formula

2011-05-05 Thread Gene Leynes
This is not mission critical, but it's bothering me. I'm getting inconsistent results when I use the $ accessor in the gam formula *In window #1:* > library(mgcv) > dat=data.frame(x=1:100,y=sin(1:100/50)+rnorm(100,0,.05)) > str(dat) > gam(dat$y~s(dat$x)) Error in eval(expr, envir, enclos) : objec

Re: [R] having trouble with "R CMD INSTALL"

2011-05-03 Thread Gene Leynes
your are talking about? Perhaps you > can make it available for further inspection of this problem? > > Uwe Ligges > > > > > > On 19.04.2011 01:55, Gene Leynes wrote: > >> Hello, >> >> I was having trouble passing in command line options when doing an

Re: [R] Way OT: Anyone know where to get data on relationship between education and salary

2011-04-19 Thread Gene Leynes
This is an amazing website which would definitely have what you want, probably in many ways. *http://www.gapminder.org/* There are a wealth of data sources, and the GUI is very intuitive and interesting. I encourage you to view a few samples to get an idea of what you can do with the "trendanalyi

[R] having trouble with "R CMD INSTALL"

2011-04-18 Thread Gene Leynes
Hello, I was having trouble passing in command line options when doing an package install earlier. >From An Introduction in R > In addition, you can > use25options > --arch=, --no-environ, --no-init-file, --no-site-file and --vanillabetw

Re: [R] File > Save As...

2011-04-13 Thread Gene Leynes
t;2011" month "04" day"11" svn.rev"55409" language "R" version.string "R version 2.13.0 RC (2011-04-11 r55409)" > On Wed, Mar 16, 2011 at 2:44 PM, Gene Leynes wrote: > > Thanks for showing me the li

Re: [R] File > Save As...

2011-04-13 Thread Gene Leynes
ciate the updates. Thanks Gene On Wed, Apr 13, 2011 at 4:33 PM, Duncan Murdoch wrote: > On 13/04/2011 5:20 PM, Gene Leynes wrote: > >> as of right now >> x = function(a) print(a) >> attr(x, "srcref") >> returns NULL in 2.13, am I doing something wron

Re: [R] File > Save As...

2011-03-16 Thread Gene Leynes
(since I didn't find it as a file in base)... And there's probably not much benefit for me to know more beyond that. So, I'll be looking forward to 2.13! On Tue, Mar 15, 2011 at 3:37 PM, Duncan Murdoch wrote: > On 15/03/2011 2:56 PM, Gene Leynes wrote: > >> The "

Re: [R] File > Save As...

2011-03-15 Thread Gene Leynes
getSrcFilename", which is really what I was after. I rarely upgrade my R versions, but this will definitely be an occasion when I do! This makes me want to go back and look at the past release notes to see what other goodies I've been overlooking. Thanks again, Gene On Mon, Mar 14, 2

Re: [R] File > Save As...

2011-03-14 Thread Gene Leynes
e R it's always kind of a hangup that requires a little more explanation, but maybe it's the way I'm looking at it. Thanks for your reply Duncan. On Mon, Mar 14, 2011 at 6:57 PM, Duncan Murdoch wrote: > On 11-03-14 5:03 PM, Gene Leynes wrote: > >> As much as I love R, th

Re: [R] Rscript, hashbang, and arguments

2011-03-14 Thread Gene Leynes
This might be off base, but would using --args help? It means "ignore everything else, Mr. R executable". However you can still parse it within the R environment. I use something like this in my startup file (.site file): if("--args" %in% commandArgs()){ i=grep("--args", commandArgs())

Re: [R] recursive do.call

2011-03-14 Thread Gene Leynes
I'm not 100% sure of your problem... It seems that you may want to consider these functions rapply mapply Also, making a separate wrapper function for what you want to do. E.g.: ModelPrinterFun = function(dat){ model = glm(dist~speed, data=dat) print(coef(model), digits=3) } Model

[R] File > Save As...

2011-03-14 Thread Gene Leynes
As much as I love R, there are still the occasional shortcomings. I would love to find a solution to the "save as..." problem. Steps to reproduce the problem: 1. Open any version of he R GUI in Windows 2. Choose "File > Open" from the menu 3. Open a script that is in a different directo

Re: [R] preventing repeat in "paste"

2011-02-25 Thread Gene Leynes
paste(s,paste(middle,collapse=""),e,collapse=" ") On Fri, Feb 25, 2011 at 4:21 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > Hello! > > s<-"start"; e<-"end" > middle<-as.character(c(1,2,3)) > > I would like to get the following result: > "start 123 end" or "start 1 2 3 end"

Re: [R] Variable names AS variable names?

2011-02-25 Thread Gene Leynes
Hello Noah, Many of these suggestions are already good, (and possibly better than you think, depending on your level of experience). Using lists helps a lot, because the elements of the list have easily accessible names, and you can query the nodes to determine how many variables you have in each

Re: [R] The L Word

2011-02-23 Thread Gene Leynes
preciate having this little additional nugget of understanding. On Wed, Feb 23, 2011 at 10:14 AM, Claudia Beleites wrote: > On 02/23/2011 05:08 PM, Gene Leynes wrote: > >> I've been wondering what L means in the R computing context, and was >> wondering if someone could

[R] The L Word

2011-02-23 Thread Gene Leynes
I've been wondering what L means in the R computing context, and was wondering if someone could point me to a reference where I could read about it, or tell me what it's called so that I can search for it myself. (L by itself is a little too general for a search term). I encounter it in strange p

Re: [R] Populate a list / recursively set list values to NA

2011-02-17 Thread Gene Leynes
Works perfectly, thank you! On Thu, Feb 17, 2011 at 4:11 PM, Erik Iverson wrote: > Gene, > > ?rapply is a recursive version of ?lapply, and should work. > > rapply(masterlist, function(x) x*NA, how = "replace") > > > --Erik > > Gene Leynes wrote: > >

[R] Populate a list / recursively set list values to NA

2011-02-17 Thread Gene Leynes
Hello all, Maybe I'm being thick, but I was trying to figure out a simple way to create a list with the same dimension of another list, but populated with NA values. masterlist = list( aa=list( a=matrix(rnorm(100),10,10), b=matrix(rnorm(130)

Re: [R] aggregate function - na.action

2011-02-06 Thread Gene Leynes
52 PM, Ista Zahn > wrote: > > Hi again, > > > > On Fri, Feb 4, 2011 at 7:18 PM, Gene Leynes wrote: > >> Ista, > >> > >> Thank you again. > >> > >> I had figured that out... and was crafting another message when you > replied. > >>

Re: [R] aggregate function - na.action

2011-02-06 Thread Gene Leynes
On Fri, Feb 4, 2011 at 6:54 PM, Ista Zahn wrote: > > > > However, I don't think you've told us what you're actually trying to > > accomplish... > > > I'm trying to aggregate the y value of a big data set which has several x's and a y. I'm using an abstracted example for many reasons. Partially,

Re: [R] aggregate function - na.action

2011-02-04 Thread Gene Leynes
s as factors. This is not feasible for me due to other complications. Also, (imho) the help should be more clear about what the na.action modifies. So, unless someone has a better idea, I guess I'm out of luck? On Fri, Feb 4, 2011 at 6:05 PM, Ista Zahn wrote: > Hi, > > On

Re: [R] aggregate function - na.action

2011-02-04 Thread Gene Leynes
hat conversion on my real data, because of other complications... I wish you could tell aggregate to use NAs in the categorical data. On Fri, Feb 4, 2011 at 6:18 PM, Gene Leynes > wrote: > Ista, > > Thank you again. > > I had figured that out... and was crafting another mess

Re: [R] aggregate function - na.action

2011-02-04 Thread Gene Leynes
; > > > sum(aggregate(y~x1+x2+x3+x4, data=dat, sum, na.action=na.fail)$y) > > sum(aggregate(y~x1+x2+x3+x4, data=dat, sum, na.action=na.pass)$y) > > sum(aggregate(y~x1+x2+x3+x4, data=dat, sum, na.action=na.omit)$y) > > > > > > Best, > > Ista > >

  1   2   >