[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

Re: [R] R Example scripts

2014-04-22 Thread Gene Leynes
, 2014 at 6:12 AM, Duncan Murdoch murdoch.dun...@gmail.com 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 time the R example files that used to be in some

[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
? -- 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 On Thu, Feb 13, 2014 at 2:17 PM, Gene Leynes gleyne...@gmail.com wrote: I was trying to understand

Re: [R] NextMethod in boxcox

2014-02-14 Thread Gene Leynes
. And knowledge is certainly not wisdom. H. Gilbert Welch On Fri, Feb 14, 2014 at 2:00 PM, Gene Leynes gleyne...@gmail.com wrote: Yes I read the help on NextMethod. In fact, since people frequently respond with did you read the help I mentioned that I had read the help in my original post

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

[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
...@gmail.com wrote: On Mon, Jun 17, 2013 at 6:11 PM, Gene Leynes gleyne...@gmail.com 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 install to 3.0.0 Have others had the same problem? [1

[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'

Re: [R] Failure to install RSer

2013-06-17 Thread Gene Leynes
On Mon, Jun 17, 2013 at 5:02 PM, Gene Leynes gleyne...@gmail.com wrote: 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

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

[R] Recursive function calls

2012-08-03 Thread Gene Leynes
(tempvec) trim(templist) trim(tempdf) Thank you, Gene Leynes _ *Data Scientist* *Mobile: 312-498-7702 **http://www.linkedin.com/in/geneleynes * http://goog_598053156*http://geneorama.com/ http://geneorama.com/%20* [[alternative HTML

Re: [R] Recursive function calls

2012-08-03 Thread Gene Leynes
, however, that the df is not returned as a df: class(trim2(tempdf)) [1] matrix Hope this helps, Rui Barradas Em 03-08-2012 17:12, Gene Leynes escreveu: My apologies, I know that this is not a new problem, but I'm not sure how to find the answer I want to recursively loop over an object

Re: [R] Recursive function calls

2012-08-03 Thread Gene Leynes
)){ 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) trimmer(templist) trimmer(tempdf) Thank you, Gene Leynes

Re: [R] Zoo panel function

2012-08-01 Thread Gene Leynes
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 _ *Data Scientist

[R] Ubuntu installation

2012-07-31 Thread Gene Leynes
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_598053156*http://geneorama.com/ http

Re: [R] Ubuntu installation

2012-07-31 Thread Gene Leynes
. 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 gley...@gmail.com wrote: I just followed

[R] Zoo panel function

2012-07-30 Thread Gene Leynes
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]] __ R-help@r

Re: [R] Seemingly simple lm giving unexpected results

2012-04-16 Thread Gene Leynes
, at 22:20, Gene Leynes wrote: 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

[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

Re: [R] Seemingly simple lm giving unexpected results

2012-04-16 Thread Gene Leynes
[mailto:r-help-boun...@r-project.org] On Behalf Of Gene Leynes Sent: Monday, April 16, 2012 12:42 AM To: peter dalgaard Cc: r-help Subject: Re: [R] Seemingly simple lm giving unexpected results Peter, This is exactly the answer I was wanted. 1) I was a little fuzzy on how the qr

Re: [R] Seemingly simple lm giving unexpected results

2012-04-14 Thread Gene Leynes
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 b...@xs4all.nl wrote: On 13-04-2012, at 22:20, Gene Leynes wrote: I

[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
R. Michael Weylandt michael.weyla...@gmail.com Kopie r-help@r-project.org, Gene Leynes gley...@gmail.com P?edm?t Re: [R] read.table performance On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote: R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file verbatim

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

[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

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 as

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 =

Re: [R] RSPython installation

2011-12-07 Thread Gene Leynes
, 2011 at 11:28 AM, Gene Leynes gleyne...@gmail.com 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 * installing to library 'C

Re: [R] read.table performance

2011-12-07 Thread Gene Leynes
in a heavily virus-scanned system directory? -pd Michael 2011/12/7 Gene Leynes gley...@gmail.com: Peter, You're quite right; it's nearly impossible to make progress without a working example. I created an ** extremely simplified ** example for distribution. The real data has numeric

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]] -

[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

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

2011-12-06 Thread Gene Leynes
OR an 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] To Try or to TryCatch, I have tried

Re: [R] read.table performance

2011-12-06 Thread Gene Leynes
)). 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 gley...@gmail.com wrote: Mark, Thank you for the reply I neglected to mention that I had already set options

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

[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

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

[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

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
, 2011 at 4:33 PM, Gene Leynes gley...@gmail.com 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 level. But I don't see the reason you want to do

[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') }

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] 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

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

2011-09-07 Thread Gene Leynes
, but the warnings (at least about not finding drives/bad exit status) should be ignorable. Cheers, Josh On Tue, Sep 6, 2011 at 2:56 PM, Gene Leynes gleyne...@gmail.com wrote: 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

[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

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 colors

[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

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
[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 dwinsem...@comcast.netwrote: On Aug 29, 2011, at 2:45 PM, Gene Leynes wrote: Why doesn't this work

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
I use zoo in R 12.0) On Mon, Aug 29, 2011 at 2:07 PM, Gene Leynes gleyne...@gmail.com wrote: Michael, By the way, although I replied to David's email, I was responding to you as well. Your results were exactly what I was expecting, but I didn't get your results. On Mon, Aug 29, 2011

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
correctly on my machine..) Michael Weylandt On Mon, Aug 29, 2011 at 2:45 PM, Gene Leynes gleyne...@gmail.com wrote: 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

Re: [R] replacing elements of a zoo object

2011-08-29 Thread Gene Leynes
(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 gleyne...@gmail.com wrote: Michael, By the way, although I replied to David's email, I was responding to you as well. Your results were exactly what I

[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

Re: [R] General indexing in multidimensional arrays

2011-08-04 Thread Gene Leynes
for) and not to replace subsets with other values. I used them, however, to program a rather akward function to do that. Seems I found one of the few aspects where Matlab actually is slightly easier to use than R. Thanks for your help! Jannis On 08/01/2011 05:50 PM, Gene Leynes wrote: What do

Re: [R] General indexing in multidimensional arrays

2011-08-04 Thread Gene Leynes
for your help! Jannis On 08/01/2011 05:50 PM, Gene Leynes wrote: What do you think about this? apply(data, 3, '[', indices) On Mon, Aug 1, 2011 at 4:38 AM, Jannisbt_jan...@yahoo.de wrote: Dear R community, I have a general question regarding indexing in multidiemensional arrays

Re: [R] General indexing in multidimensional arrays

2011-08-04 Thread Gene Leynes
is slightly easier to use than R. Thanks for your help! Jannis On 08/01/2011 05:50 PM, Gene Leynes wrote: What do you think about this? apply(data, 3, '[', indices) On Mon, Aug 1, 2011 at 4:38 AM, Jannisbt_jan...@yahoo.de wrote: Dear R community, I have a general

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 amccu...@yahoo.co.ukwrote: 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

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 bt_jan...@yahoo.de 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

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

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

2011-07-28 Thread Gene Leynes
, 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 dwinsem...@comcast.netwrote: On Jul 27, 2011, at 7:44 PM, Gene Leynes wrote

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 dwinsem...@comcast.netwrote: 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
) 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, Jul 27, 2011 at 3:22 PM, Gene Leynes gleyne...@gmail.com wrote: I have tried

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

2011-07-28 Thread Gene Leynes
be a disaster. On Thu, Jul 28, 2011 at 2:45 PM, David Winsemius dwinsem...@comcast.netwrote: 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.slightly.clumsy = lapply

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

[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] ?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

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? I

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

2011-07-27 Thread Gene Leynes
LastColumn = ncol(mat) print(mat[2,LastColumn]) } On Wed, Jul 27, 2011 at 5:45 PM, David Winsemius dwinsem...@comcast.netwrote: 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 apply work in a generalized way

[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

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 murdoch.dun...@gmail.comwrote: 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 into my

[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

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

2011-05-25 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 ehl...@ucalgary.ca wrote: On 2011-05-23 16:54, Gene Leynes wrote: I wrote a little

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

[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
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 gavin.simp...@ucl.ac.ukwrote: On Fri, 2011-05-06 at 11:20 -0500, Gene Leynes

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

[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) : object

Re: [R] having trouble with R CMD INSTALL

2011-05-03 Thread Gene Leynes
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 package install earlier. From An Introduction in R In addition, you

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

[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 use25http://cran.r-project.org/doc/manuals/R-intro.html#fn-25options --arch=, --no-environ, --no-init-file, --no-site-file and --vanillabetween

Re: [R] File Save As...

2011-04-14 Thread Gene Leynes
2.13.0 RC (2011-04-11 r55409) On Wed, Mar 16, 2011 at 2:44 PM, Gene Leynes gleyne...@gmail.com wrote: Thanks for showing me the link to the code / your response / your work in general. It seems that the real magic is happening in the call to the function attributes, via the line attr(x

Re: [R] File Save As...

2011-04-13 Thread Gene Leynes
, Duncan Murdoch murdoch.dun...@gmail.comwrote: 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 wrong? There's a limitation to the debug information: it can't be attached to a function whose

Re: [R] File Save As...

2011-03-16 Thread Gene Leynes
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 murdoch.dun...@gmail.comwrote: On 15/03/2011 2:56 PM, Gene Leynes wrote: The getSrcFilename function

Re: [R] File Save As...

2011-03-15 Thread Gene Leynes
, 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, 2011 at 8:17 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 11-03-14 8:12 PM, Gene Leynes wrote

[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 directory

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) }

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] File Save As...

2011-03-14 Thread Gene Leynes
, 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 murdoch.dun...@gmail.comwrote: On 11-03-14 5:03 PM, Gene Leynes wrote: As much as I love R, there are still the occasional shortcomings. I would love to find a solution

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 or start 1,2,3 end

[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

Re: [R] The L Word

2011-02-23 Thread Gene Leynes
this little additional nugget of understanding. On Wed, Feb 23, 2011 at 10:14 AM, Claudia Beleites cbelei...@units.itwrote: 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 point me to a reference where I could

[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),

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 er...@ccbr.umn.edu wrote: Gene, ?rapply is a recursive version of ?lapply, and should work. rapply(masterlist, function(x) x*NA, how = replace) --Erik Gene Leynes wrote: Hello all, Maybe I'm being thick

Re: [R] aggregate function - na.action

2011-02-06 Thread Gene Leynes
On Fri, Feb 4, 2011 at 6:54 PM, Ista Zahn iz...@psych.rochester.edu 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

Re: [R] aggregate function - na.action

2011-02-06 Thread Gene Leynes
...@psych.rochester.edu wrote: Hi again, On Fri, Feb 4, 2011 at 7:18 PM, Gene Leynes gleyne...@gmail.com wrote: Ista, Thank you again. I had figured that out... and was crafting another message when you replied. The NAs do come though on the variable that is being aggregated, However

[R] aggregate function - na.action

2011-02-04 Thread Gene Leynes
Can someone please tell me what is up with na.action in aggregate? My (somewhat) reproducible example: (I say somewhat because some lines wouldn't run in a separate session, more below) set.seed(100) dat=data.frame( x1=sample(c(NA,'m','f'), 100, replace=TRUE), x2=sample(c(NA,

Re: [R] how to learn more from R

2011-02-04 Thread Gene Leynes
Search the help archive and you'll find dozens of suggestions about beginner manuals You can search the archive at nabble.com or markmail.com http://r-project.markmail.org/ http://r.789695.n4.nabble.com/R-help-f789696.html (I don't know why the nabble URL is so complicated) For seeing R

Re: [R] aggregate function - na.action

2011-02-04 Thread Gene Leynes
=na.pass)$y) sum(aggregate(y~x1+x2+x3+x4, data=dat, sum, na.action=na.omit)$y) Best, Ista On Fri, Feb 4, 2011 at 4:07 PM, Gene Leynes gleyne...@gmail.comgleynes%...@gmail.com wrote: Can someone please tell me what is up with na.action in aggregate? My (somewhat) reproducible

Re: [R] aggregate function - na.action

2011-02-04 Thread Gene Leynes
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 iz...@psych.rochester.edu wrote: Hi, On Fri, Feb 4, 2011 at 6:33 PM, Gene Leynes

Re: [R] aggregate function - na.action

2011-02-04 Thread Gene Leynes
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 gleyne...@gmail.comgleynes%...@gmail.com wrote: Ista, Thank you again. I had figured that out... and was crafting another message when you replied. The NAs do come

  1   2   >