Re: [Rd] [PATCH] show vector length in summary()

2013-09-10 Thread Dirk Eddelbuettel

On 10 September 2013 at 10:32, Sam Steingold wrote:
| (summary.default): show the vector length in addition to quantiles
| 
| 
| diff -u -i -p -F '^(def' -b -w -B 
/home/sds/src/R-3.0.1/src/library/base/R/summary.R.old 
/home/sds/src/R-3.0.1/src/library/base/R/summary.R
| --- /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old2013-03-05 
18:02:33.0 -0500
| +++ /home/sds/src/R-3.0.1/src/library/base/R/summary.R2013-09-10 
10:19:02.682946339 -0400
| @@ -39,6 +39,7 @@ summary.default <-
|   qq <- stats::quantile(object)
|   qq <- signif(c(qq[1L:3L], mean(object), qq[4L:5L]), digits)
|   names(qq) <- c("Min.", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max.")
| +  qq <- c(qq,"Length" = length(object))
|   if(any(nas))
|   c(qq, "NA's" = sum(nas))
|   else qq
| 
| Diff finished.  Tue Sep 10 10:19:40 2013

Base R functions are rarely modified; others may have expectations on
summary() returning the six values it returns.

Many alternatives are available, including describe in Hmisc which returns
the count you suggest, and a count of missingness.

R> set.seed(42)
R> describe(rnorm(100))
rnorm(100) 
  n missing  uniqueMean .05 .10 .25 .50 .75 .90 
.95 
100   0 100 0.03251 -1.7641 -1.2117 -0.6167  0.0898  0.6616  1.3730 
 1.5116 

lowest : -2.993 -2.656 -2.440 -2.414 -1.781, highest:  1.513  1.576  1.895  
2.018  2.287 
R> 


Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] [PATCH] show vector length in summary()

2013-09-10 Thread Sam Steingold
(summary.default): show the vector length in addition to quantiles


diff -u -i -p -F '^(def' -b -w -B 
/home/sds/src/R-3.0.1/src/library/base/R/summary.R.old 
/home/sds/src/R-3.0.1/src/library/base/R/summary.R
--- /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old  2013-03-05 
18:02:33.0 -0500
+++ /home/sds/src/R-3.0.1/src/library/base/R/summary.R  2013-09-10 
10:19:02.682946339 -0400
@@ -39,6 +39,7 @@ summary.default <-
qq <- stats::quantile(object)
qq <- signif(c(qq[1L:3L], mean(object), qq[4L:5L]), digits)
names(qq) <- c("Min.", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max.")
+  qq <- c(qq,"Length" = length(object))
if(any(nas))
c(qq, "NA's" = sum(nas))
else qq

Diff finished.  Tue Sep 10 10:19:40 2013


-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 11.0.11303000
http://www.childpsy.net/ http://dhimmi.com http://openvotingconsortium.org
http://thereligionofpeace.com http://www.memritv.org http://camera.org
Between grand theft and a legal fee, there only stands a law degree.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD config for R >= 3.0.1

2013-09-10 Thread crunch
I need to build R on a Centos machine where I have no admin privileges.
Believe I have to build from source, but cannot find the configure script in
the source bundle.  Am I missing something?



--
View this message in context: 
http://r.789695.n4.nabble.com/R-CMD-config-for-R-3-0-1-tp4667399p4675813.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD config for R >= 3.0.1

2013-09-10 Thread crunch
Also have no cooperation from the admin of the machine, so can't ask for a
yum install.



--
View this message in context: 
http://r.789695.n4.nabble.com/R-CMD-config-for-R-3-0-1-tp4667399p4675814.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD config for R >= 3.0.1

2013-09-10 Thread Simon Urbanek
On Sep 10, 2013, at 5:30 PM, crunch wrote:

> Also have no cooperation from the admin of the machine, so can't ask for a
> yum install.
> 

Please follow Brian's advice. If you don't have even Fortran on that machine, 
then you're really in a pickle: you can extract the gfortran rpm contents (and 
all dependencies you may need) by hand in any place that you have access to and 
adjust LD_LIBRARY_PATH for the runtime accordingly. However, it's not a trivial 
task - it particular if you're not very familiar with subtleties of Linux. (I 
had to do this fairly recently on a CentOS machine, so I know it's possible, 
but there are a few gotchas that may require a few symlinks created by hand).

Cheers,
Simon


> 
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/R-CMD-config-for-R-3-0-1-tp4667399p4675814.html
> Sent from the R devel mailing list archive at Nabble.com.
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [PATCH] show vector length in summary()

2013-09-10 Thread Simon Urbanek

On Sep 10, 2013, at 12:56 PM, Sam Steingold wrote:

>> * Dirk Eddelbuettel  [2013-09-10 10:21:33 -0500]:
>> 
>> On 10 September 2013 at 10:32, Sam Steingold wrote:
>> | (summary.default): show the vector length in addition to quantiles
>> | 
>> | 
>> | diff -u -i -p -F '^(def' -b -w -B 
>> /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old 
>> /home/sds/src/R-3.0.1/src/library/base/R/summary.R
>> | --- /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old 2013-03-05 
>> 18:02:33.0 -0500
>> | +++ /home/sds/src/R-3.0.1/src/library/base/R/summary.R 2013-09-10 
>> 10:19:02.682946339 -0400
>> | @@ -39,6 +39,7 @@ summary.default <-
>> |qq <- stats::quantile(object)
>> |qq <- signif(c(qq[1L:3L], mean(object), qq[4L:5L]), digits)
>> |names(qq) <- c("Min.", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max.")
>> | +  qq <- c(qq,"Length" = length(object))
>> |if(any(nas))
>> |c(qq, "NA's" = sum(nas))
>> |else qq
>> | 
>> | Diff finished.  Tue Sep 10 10:19:40 2013
>> 
>> Base R functions are rarely modified; others may have expectations on
>> summary() returning the six values it returns.
> 
> Note that summary sometimes returns 5 values (when there no "NA's").
> It is clearly wrong to rely on the details of the return value of a UI 
> function.
> 

.. except that summary() is not a UI function. It is used to create summary 
*objects*, not some UI output. Although sometimes users like to print such 
summary objects, that is not the task of summary(). There are quite common 
programmatic uses of summary() -- one prominent one that comes to my mind is in 
conjunction with connections.
 (Not that any of this has anything to do with the original question ... )


>> Many alternatives are available, including describe in Hmisc which
>> returns the count you suggest, and a count of missingness.
> 
> Such a minor issue hardly justifies installing a whole new package.
> (but thanks for the suggestion!)
> 
> -- 
> Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 
> 11.0.11303000
> http://www.childpsy.net/ http://www.memritv.org http://palestinefacts.org
> http://www.PetitionOnline.com/tap12009/ http://pmw.org.il http://dhimmi.com
> WHO ATE MY BREAKFAST PANTS?
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD config for R >= 3.0.1

2013-09-10 Thread Prof Brian Ripley

On 10/09/2013 22:24, crunch wrote:

I need to build R on a Centos machine where I have no admin privileges.
Believe I have to build from source, but cannot find the configure script in
the source bundle.  Am I missing something?


Yes, as it is there.  We can only guess that 'the source bundle' you 
have is not the correct file. As 3.0.2 is close, I would start with 
R-patched from ftp://ftp.stat.math.ethz.ch/Software/R/ (a link on the 
CRAN front page).


It contains an installation manual, online at 
http://cran.r-project.org/doc/manuals/r-patched/R-admin.html


[What may be more of a problem is installing the tools you need: does 
your box have a Fortran compiler, for example?]



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [PATCH] show vector length in summary()

2013-09-10 Thread Sam Steingold
> * Dirk Eddelbuettel  [2013-09-10 10:21:33 -0500]:
>
> On 10 September 2013 at 10:32, Sam Steingold wrote:
> | (summary.default): show the vector length in addition to quantiles
> | 
> | 
> | diff -u -i -p -F '^(def' -b -w -B 
> /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old 
> /home/sds/src/R-3.0.1/src/library/base/R/summary.R
> | --- /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old  2013-03-05 
> 18:02:33.0 -0500
> | +++ /home/sds/src/R-3.0.1/src/library/base/R/summary.R  2013-09-10 
> 10:19:02.682946339 -0400
> | @@ -39,6 +39,7 @@ summary.default <-
> | qq <- stats::quantile(object)
> | qq <- signif(c(qq[1L:3L], mean(object), qq[4L:5L]), digits)
> | names(qq) <- c("Min.", "1st Qu.", "Median", "Mean", "3rd Qu.", "Max.")
> | +  qq <- c(qq,"Length" = length(object))
> | if(any(nas))
> | c(qq, "NA's" = sum(nas))
> | else qq
> | 
> | Diff finished.  Tue Sep 10 10:19:40 2013
>
> Base R functions are rarely modified; others may have expectations on
> summary() returning the six values it returns.

Note that summary sometimes returns 5 values (when there no "NA's").
It is clearly wrong to rely on the details of the return value of a UI function.

> Many alternatives are available, including describe in Hmisc which
> returns the count you suggest, and a count of missingness.

Such a minor issue hardly justifies installing a whole new package.
(but thanks for the suggestion!)

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 11.0.11303000
http://www.childpsy.net/ http://www.memritv.org http://palestinefacts.org
http://www.PetitionOnline.com/tap12009/ http://pmw.org.il http://dhimmi.com
WHO ATE MY BREAKFAST PANTS?

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Package installation and path.package

2013-09-10 Thread Simon Zehnder
Hi Simon,

thank you for this comment! I will do it now the regular way - this is always 
the most reliable one. 

Best

Simon

On Sep 9, 2013, at 3:29 PM, Simon Urbanek  wrote:

> e you need something that the user has write-permissions for.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Package installation and path.package

2013-09-10 Thread Simon Zehnder
Hi Dirk,

thanks for the help I take a more thorough look at it. 

Best

Simon

On Sep 9, 2013, at 3:41 PM, Dirk Eddelbuettel  wrote:

> 
> On 9 September 2013 at 09:26, Simon Urbanek wrote:
> | On Sep 9, 2013, at 4:22 AM, Simon Zehnder wrote:
> | > I am writing right now my own package that makes use of 'tempfile' and
> | > there within with 'path.package'. When I install it, I get the error: 
> Error
> | > in path.package("mypackage") : none of the packages are loaded. Here is 
> the
> | > code, I use in my package:
> [...]
> | That path to your package is dynamic - in general it will not be know when
> | creating the lazy-load DB, so you really want to put that code in .onLoad()
> | where the path is known. 
> 
> And you may want to use   system.file()   rather than path.package(), at
> least if I understand the question right.
> 
> Here is what I use to share the bibtex file for the Rcpp vignettes with other
> Rcpp* package vignettes:
> 
>   R> system.file(package="Rcpp", "doc", "Rcpp.bib")
>   [1] "/usr/local/lib/R/site-library/Rcpp/doc/Rcpp.bib"
>   R> 
> 
> Answer conditional on my particular Linux system, but the path is guaranteed
> to be valid as long as Rcpp is installed which one can ensure via Depends:
> from another package.
> 
> Dirk
> 
> -- 
> Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [PATCH] show vector length in summary()

2013-09-10 Thread Michael Weylandt


On Sep 10, 2013, at 18:38, Simon Urbanek  wrote:

> 
> On Sep 10, 2013, at 12:56 PM, Sam Steingold wrote:
> 
>>> * Dirk Eddelbuettel  [2013-09-10 10:21:33 -0500]:
>>> 
>>> On 10 September 2013 at 10:32, Sam Steingold wrote:
>>> | (summary.default): show the vector length in addition to quantiles
>>> | 
>>> | 
>>> | diff -u -i -p -F '^(def' -b -w -B 
>>> /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old 
>>> /home/sds/src/R-3.0.1/src/library/base/R/summary.R
>>> | --- /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old2013-03-05 
>>> 18:02:33.0 -0500
>>> | +++ /home/sds/src/R-3.0.1/src/library/base/R/summary.R2013-09-10 
>>> 10:19:02.682946339 -0400
>>> | @@ -39,6 +39,7 @@ summary.default <-
>>> |  qq <- stats::quantile(object)
>>> |  qq <- signif(c(qq[1L:3L], mean(object), qq[4L:5L]), digits)
>>> |  names(qq) <- c("Min.", "1st Qu.", "Median", "Mean", "3rd Qu.", 
>>> "Max.")
>>> | +  qq <- c(qq,"Length" = length(object))
>>> |  if(any(nas))
>>> |  c(qq, "NA's" = sum(nas))
>>> |  else qq
>>> | 
>>> | Diff finished.  Tue Sep 10 10:19:40 2013
>>> 
>>> Base R functions are rarely modified; others may have expectations on
>>> summary() returning the six values it returns.
>> 
>> Note that summary sometimes returns 5 values (when there no "NA's").
>> It is clearly wrong to rely on the details of the return value of a UI 
>> function.
> 
> .. except that summary() is not a UI function. It is used to create summary 
> *objects*, not some UI output. Although sometimes users like to print such 
> summary objects, that is not the task of summary(). There are quite common 
> programmatic uses of summary() -- one prominent one that comes to my mind is 
> in conjunction with connections.
> (Not that any of this has anything to do with the original question ... )

As Simon surely knows but others perhaps not:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-should-I-write-summary-methods_003f

MW


> 
> 
>>> Many alternatives are available, including describe in Hmisc which
>>> returns the count you suggest, and a count of missingness.
>> 
>> Such a minor issue hardly justifies installing a whole new package.
>> (but thanks for the suggestion!)
>> 
>> -- 
>> Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 
>> 11.0.11303000
>> http://www.childpsy.net/ http://www.memritv.org http://palestinefacts.org
>> http://www.PetitionOnline.com/tap12009/ http://pmw.org.il http://dhimmi.com
>> WHO ATE MY BREAKFAST PANTS?
>> 
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD config for R >= 3.0.1

2013-09-10 Thread Brian Lee Yung Rowe
As an alternative, you might consider installing a virtual machine in your user 
space and installing R from there. That way you don't have to do a bunch of 
one-off gymnastics to get R compiled. 



On Sep 11, 2013, at 1:40 AM, Simon Urbanek  wrote:

> On Sep 10, 2013, at 5:30 PM, crunch wrote:
> 
>> Also have no cooperation from the admin of the machine, so can't ask for a
>> yum install.
> 
> Please follow Brian's advice. If you don't have even Fortran on that machine, 
> then you're really in a pickle: you can extract the gfortran rpm contents 
> (and all dependencies you may need) by hand in any place that you have access 
> to and adjust LD_LIBRARY_PATH for the runtime accordingly. However, it's not 
> a trivial task - it particular if you're not very familiar with subtleties of 
> Linux. (I had to do this fairly recently on a CentOS machine, so I know it's 
> possible, but there are a few gotchas that may require a few symlinks created 
> by hand).
> 
> Cheers,
> Simon
> 
> 
>> 
>> --
>> View this message in context: 
>> http://r.789695.n4.nabble.com/R-CMD-config-for-R-3-0-1-tp4667399p4675814.html
>> Sent from the R devel mailing list archive at Nabble.com.
>> 
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel