[Rd] as.data.frame.table responseName argument (PR#8006)

Heather.Turner@warwick.ac.uk Heather.Turner at warwick.ac.uk
Wed Jul 13 13:26:17 CEST 2005


Full_Name: Heather Turner
Version: 2.1.1
OS: Windows XP
Submission from: (NULL) (137.205.240.44)


I get an error when trying to use the responseName argument of
as.data.frame.table, e.g.

> ## Create table
> f <- gl(3, 3)
> tab <- table(f)
> tab
f
1 2 3 
3 3 3 
> ## Convert to data.frame - works fine
> dat1 <- as.data.frame(tab)
> dat1
  f Freq
1 1    3
2 2    3
3 3    3
> ## As above with responseName - get error
> dat2 <- as.data.frame(tab, responseName = "count")
Error in as.data.frame(tab, responseName = "count") : 
	unused argument(s) (responseName ...)

I have checked the arguments of as.data.frame.table and responseName is there:
> args(as.data.frame.table)
function (x, row.names = NULL, optional = FALSE, responseName = "Freq", 
    ...) 
NULL
but I notice as.data.frame has no dots argument
> args(as.data.frame)
function (x, row.names = NULL, optional = FALSE) 
NULL
which would (I think) explain the error,

Heather



More information about the R-devel mailing list