Reputation: 157
df1<-read_excel('exam.xlsx')
names(df1)
[1] "HAART_reg" "Base_CD4" "CD4_at_12" "diabetes"
[5] "hypertension" "tuberculosis" "Base" "CD412"
I want to make a cross table using the variables Base
and CD412
which are categorical variables with levels 0
and 1
library(expss)
cro(df1$Base,df1$CD412)
The following error message appears:
Error in name_dots(...) : could not find function "name_dots"
How to fix this?
Upvotes: 1
Views: 385
Reputation: 346
How about trying devtools::install_github("gdemin/expss")
?
Or the second option is to run:
name_dots <- function(...) {
dot_sub <- as.list(substitute(list(...)))[-1L]
vnames = names(dot_sub)
if (is.null(vnames)) {
vnames = rep.int("", length(dot_sub))
novname = rep.int(TRUE, length(dot_sub))
} else {
vnames[is.na(vnames)] = ""
if (any(vnames==".SD")) stop("A column may not be called .SD. That has special meaning.")
novname = vnames==""
}
for (i in which(novname)) {
if ((tmp <- deparse(dot_sub[[i]])[1L]) == make.names(tmp))
vnames[i] = tmp
}
still_empty = vnames==""
if (any(still_empty)) vnames[still_empty] = paste0("V", which(still_empty))
list(vnames=vnames, novname=novname)
}
Reference: https://github.com/Rdatatable/data.table/blob/master/R/utils.R
Upvotes: 2