Re: [R] code optimisation problem

2012-11-27 Thread cberry
Rui Barradas writes: > Hello, > > Package 'compiler' is good at optimizing for loops. Try the following. > Or vectorize the function > system.time(f1(x,10)) user system elapsed 5.010.005.00 > system.time(f1.c(x,10)) user system elapsed 1.920.001.91 > f2 <- func

Re: [R] Help: is there a R Package for L1-regression (not regression with L1-penalty)

2012-11-21 Thread cberry
"Chee Chen" writes: > Dear All, > Is there a R package for L1-regression (meaning, optimize the sum of > absolute deviations, NOT TO BE UNDERSTOOD as regression with > L1-penalty) ? Yes. > Any information will be appreciated. See http://cran.cnr.berkeley.edu/web/views/Robust.html HTH,

Re: [R] Question on callNextMethod

2012-11-06 Thread cberry
t; > Produces the output: > > [1] "derived called" > [1] "base called" > [1] "base called" > > > and I was expecting: > > [1] "derived called" > [1] "base called" > > > Thanx in advance, > Simon Knapp > > [[al

Re: [R] summation coding

2012-10-19 Thread cberry
djbanana writes: > Hi, > > I think I solved it myself by writing loops. > > What I meant is: are there in-built functions in R that calculate the > following: > > a1(b2+...+b190) + a2(b1+b3+...+b190) + ... Following Rainer's setup: x <- data.frame( a = sample( 1:10, 4 ), b = sample( 11:20, 4 )

Re: [R] uniq -c

2012-10-16 Thread cberry
Sam Steingold writes: > I need an analogue of "uniq -c" for a data frame. The count.rows() function is the R analogue. See http://orgmode.org/worg/org-contrib/babel/examples/Rpackage.html#sec-6-1 No need to install the package - just copy and paste the function into an R session. On cases I

Re: [R] Test for Random Points on a Sphere

2012-10-06 Thread cberry
e is something in R to meet your needs. A post to r-sig-geo might get more helpful responses once you can focus the question a bit more. HTH, Chuck > Many thanks > > Lorenzo > -- Charles C. BerryDept of Family/Preventive Medicine cberry at ucsd edu

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread cberry
other programming languages (like Java)? >>> >>> Thanks, >>> -J >>> >>> __ >>> R-help@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read th

Re: [R] looking for accessibility help (blind student)

2012-08-08 Thread cberry
= > > Peter Petto > Lakewood High School Math cell: 440.249.4289 > [[alternative HTML version deleted]] > -- Charles C. BerryDept of Family/Preventive Medicine cberry at ucsd edu UC Sa

Re: [R] Poisson Ridge Regression

2012-07-07 Thread cberry
start. So is rseek.org where 'poisson ridge regression' gives lots of hits. If you click on 'functions' there is a link to the 'glmnet' package, which is a solid engine for penalized poisson regression. HTH, Chuck -- Charles C. Berry

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread cberry
log(x1) + x2 * x3 >> newFmla[[3]][[2]] > log(x1) >> newFmla[[3]][[2]][[2]] > x1 > > So, if you could tell me of a general way to "walk" though a formula > object, couldn't I use "gsub" or something like that to recognize each > instance of "x1&qu

Re: [R] Generate Dendrogram

2012-04-30 Thread cberry
to plot.hclust rather than plot.dendrogram. Try plot( dend1, ... ) HTH, Chuck > > Br, > Luffy > -- Charles C. BerryDept of Family/Preventive Medicine cberry at ucsd edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry

Re: [R] how to cut files from any folder to another folder?

2012-04-22 Thread cberry
o-cut-files-from-any-folder-to-another-folder-tp4577818p4577818.html > Sent from the R help mailing list archive at Nabble.com. > -- Charles C. Berry Dept of Family/Preventive Medicine cberry at ucsd edu UC San Diego http://famprevmed.ucsd.

Re: [R] working with environments to ensure code quality for long R scripts

2012-04-19 Thread cberry
__ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >

Re: [R] Looking for the name of a certain kind of quantile plot

2012-04-04 Thread cberry
t > of any real use in statistical analysis? > > thanks. > Carl -- Charles C. BerryDept of Family/Preventive Medicine cberry at ucsd edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901 ___

Re: [R] sqrt(-x) vs. -x^0.5

2012-03-21 Thread cberry
f this line: lapply( as.list( quote(-1-4) ), as.list ) and (thereby) explain why the result of -1-4 isn't 3. HTH, Chuck [rest deleted] -- Charles C. Berry Dept of Family/Preventive Medicine cberry at ucsd edu UC San Diego h

Re: [R] extracting the i-th row of a matrix in a list of lists

2012-03-09 Thread cberry
'j=TRUE'. Note: all.equal( lapply(lapply(x0, '[[', 3), '[', i=2,j=TRUE), lapply(lapply(x0, '[[', 3), '[', i=2, j=1:2) ) HTH, Chuck > or should I really stick with: > > lapply(lapply(x1, '[[', 3), f

Re: [R] Why does the order of terms in a formula translate into different models/ model matrices?

2012-01-27 Thread cberry
f design matrices: > qr(X1)$rank ## 9 > > qr(X2)$rank ## 10 > > > Will be very grateful if someone could help me here! > > Thanks, > > Alexandra > > > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Why-does-the-order-

Re: [R] Need help interpreting the logit regression function

2012-01-15 Thread cberry
.factor(indep) , family = binomial(link = >>"logit"),na.action = na.pass) > (Intercept) as.factor(indep)3 > -1.0986-0.2877 > > Now, exp(-1.0986) = 0. and exp(-1.0986-0.2877) = 0.25. > > These are nothing like the previous odds halv

Re: [R] Averaging within a range of values

2012-01-14 Thread cberry
-- > View this message in context: > http://r.789695.n4.nabble.com/Averaging-within-a-range-of-values-tp4291958p4294061.html > Sent from the R help mailing list archive at Nabble.com. > -- Charles C. BerryDept of Family/Preventive Medicine cberry at ucs

Re: [R] Putting an index explicitly into function code --- a curiosity.

2012-01-07 Thread cberry
is created by bquote(). Replacing eval(e[[2L]], where) by { e[[1L]] <- as.name("force") eval(e) eval(e[[2L]], where) } seems to handle this case without breaking example(bquote). HTH, Chuck > Duncan Murdoch > -- Charles C. Ber

Re: [R] qqnorm & huge datasets

2011-12-22 Thread cberry
>> [1] 10233     2 >>> plot(qq.slim) >>> >> >> Choose the digits arg in round to be large enough to allow for points that >> do not overlap >> to be seen and small enough to slim down the number of plotted >> points. In the example above, 1

Re: [R] qqnorm & huge datasets

2011-12-22 Thread cberry
digits arg in round to be large enough to allow for points that do not overlap to be seen and small enough to slim down the number of plotted points. In the example above, 10233 vs 10. HTH, Chuck -- Charles C. Berry Dept of Family/Preventive Medicine cberry at ucsd

Re: [R] column permutation of sparse matrix

2011-12-21 Thread cberry
pairs are not unique. (e.g. 3.709 is seen in M2, but not M1) I think the OP was asking for permutations of the non-zero values in 'res', rather than permutations of M1@x. HTH, Chuck >> >> I don't have experience with sparse matrices, but I was able to get this >>

Re: [R] fundamental guide to use of numerical optimizers?

2011-12-15 Thread cberry
generalizations? Are there other tips that > everybody ought to know? > > I understand this is a vague question, perhaps the answers are just in > the folklore. But if somebody has written them out, I would be glad to > know. -- Charles C. Berry Dept of Family/

Re: [R] Multicollinearty in logistic regression models

2011-12-15 Thread cberry
by ...' and page through the results to find good leads on this topic. HTH, Chuck > >> Thank you in advance >> M >> >> -- >> >> Mohamed Lajnef,IE INSERM U955 eq 15# > > > David Winsemius, MD > West Hartford, CT > -- Charles C. Berry

Re: [R] k-folds cross validation with conditional logistic

2011-12-13 Thread cberry
> > Terry T > -- Charles C. BerryDept of Family/Preventive Medicine ccberry at ucsd dot edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901 __ R-help

Re: [R] Maximization Problem

2011-10-25 Thread cberry
eted]] > -- Charles C. BerryDept of Family/Preventive Medicine cbe...@tajo.ucsd.edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901 __ R-help@r-project.org