Skip to content

Hmisc describe error

6 messages · David Winsemius, Bond, Stephen

#
Describe fails for me with a message similar to what was an issue in 2008 and got fixed according to posts.

R version 2.15.0 (2012-03-30)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)

# output truncated
Loading required package: Hmisc
Loading required package: survival
Loading required package: splines
Hmisc library by Frank E Harrell Jr

Type library(help='Hmisc'), ?Overview, or ?Hmisc.Overview')
to see overall documentation.

NOTE:Hmisc no longer redefines [.factor to drop unused levels when
subsetting.  To get the old behavior of Hmisc type dropUnusedLevels().


Attaching package: 'Hmisc'

The following object(s) are masked from 'package:survival':

    untangle.specials

The following object(s) are masked from 'package:base':

    format.pval, round.POSIXt, trunc.POSIXt, units


Attaching package: 'rms'

The following object(s) are masked from 'package:survival':

    Surv
Error in format(dates(x)) : could not find function "dates"
Thanks everybody.
Stephen
#
The error is just a misleading error message. loading the data produced
column sdate as
$ sdate :Classes 'labelled', 'dates'  atomic [1:502] 2778 2820 2933 2999
3002 ...
  .. ..- attr(*, "format")= symbol ddmmmyy
  .. ..- attr(*, "label")= chr "Date on study"

prostate$sdate <- as.Date(prostate$sdate,origin="1970-01-01")  # fixes the
problem and 'describe' runs

just as a comment: maybe the R dataset should have sdate as a Date class.



--
View this message in context: http://r.789695.n4.nabble.com/Hmisc-describe-error-tp4644708p4644711.html
Sent from the R help mailing list archive at Nabble.com.
#
On Oct 1, 2012, at 9:33 AM, Bond, Stephen wrote:

            
Iget anerror when I use that code.
Error in describe(prostate) : object 'prostate' not found

And when I attempt loading it get:
data(prostate)

So you must have a different set of objects or packages loaded on your installation than I do.


David Winsemius, MD
Alameda, CA, USA
#
On Oct 1, 2012, at 9:48 AM, stephenb wrote:

            
What "R dataset"? From what package?

And it's already a "dates"-classed variable.
#
Just as a clarification: I downloaded 'prostate.sav' from F. Harrell's website. For some reason
Warning message:
In data(prostate) : data set 'prostate' not found

I don't have the prostate data set as is.

-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net] 
Sent: Monday, October 01, 2012 12:53 PM
To: Bond, Stephen
Cc: r-help at r-project.org
Subject: Re: [R] Hmisc describe error
On Oct 1, 2012, at 9:33 AM, Bond, Stephen wrote:

            
Iget anerror when I use that code.
Error in describe(prostate) : object 'prostate' not found

And when I attempt loading it get:
data(prostate)

So you must have a different set of objects or packages loaded on your installation than I do.


David Winsemius, MD
Alameda, CA, USA
#
On Oct 1, 2012, at 10:27 AM, David Winsemius wrote:

            
Not only that, but there is a message at the top of Harrell's Datasets page that says:

"For R users of the prostate dataset, put library(chron) into effect to handle date variables. A simpler approach is to just convert the one date variable to the built-in R format by running the command prostate$sdate <- as.Date(prostate$sdate)."