Tracking down error: stringsAsFactors [Power / Sample Size]

posted by d_labes  – Berlin, Germany, 2020-05-13 13:34 (1666 d 12:52 ago) – Posting: # 21431
Views: 10,100

Dear Helmut, dear Alyssa!

❝ ❝ Then i continued with the following command but it appeared error: […]


❝ Let’s try to figure it out. Execute this code:

❝ ...

❝ res <- data.frame(design = rep(designs, each = length(target)),

❝ target = target, n = NA, power = NA)


This line is the casus knacktus!
The error
Error in match.arg(design) : 'arg' must be NULL or a character vector
means that the design argument in the call of sampleN.scABEL() is not character.
Reason:
Before R4.0.0 the optional argument stringsAsFactors in the call of data.frame() was TRUE. Changed in R4.0.0 to FALSE.
Check this in your installation via
default.stringsAsFactors()
If you get TRUE as answer change
res     <- data.frame(design = rep(designs, each = length(target)),
                      target = target, n = NA, power = NA,
                      stringsAsFactors = FALSE)

and than I'm sure that it works.

All the best

Regards,

Detlew

Complete thread:

UA Flag
Activity
 Admin contact
23,332 posts in 4,899 threads, 1,660 registered users;
20 visitors (0 registered, 20 guests [including 8 identified bots]).
Forum time: 01:27 CET (Europe/Vienna)

I don’t write drafts.
I write from the beginning to the end,
and when it’s finished, it’s done.    Clifford Geertz

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5