R Error when using function summary_table and qwraps2

1.2k Views Asked by At

I am trying to create a table 1 using dplyr and qwraps. These are both installed. I am getting the error below. Does anyone have any suggestions?

c1<-
  list("Descriptive statistics" =
     list("Samples, n(%)" = ~ qwraps2::n_perc0(M$m.count>=1),
          "Subjects, n" = ~ qwraps2::n_perc0(m.count$Freq>=1),
          "Age, median, IQR" = ~ qwraps2::median_iqr(M$Age))
  )
summary_table(M, c1)

Error in summary_table(M, c1) : 
 could not find function "summary_table"
1

There are 1 best solutions below

0
Peter_Evan On

I would A) double check that the qwarps2 package is installed in your current working environment by checking the "package" tab in R studio. You can also type this handy code into the console :

 ip <- as.data.frame(installed.packages()[,c(1,3:4)])
 rownames(ip) <- NULL
 ip <- ip[is.na(ip$Priority),1:2,drop=FALSE]
 print(ip, row.names=FALSE)` into your console. 

B) avoid any potential masking by explicitly calling the function, such as qwarps2::summary_table(M, c1)