Skip to content

Error in sort.list(y) : 'x' must be atomic for 'sort.list' #387

@KohSoonho

Description

@KohSoonho

Hi, I'm using a follow script

## creating simulation data
control_mutant <- list(rate = 0.03, rep = 25, treat = "control", genotype = "mutant")
treat_mutant <- list(rate = 0.03 * 0.55, rep = 125, treat = "treat", genotype = "mutant")
control_wild <- list(rate = 0.03 * 0.2, rep = 125, treat = "control", genotype = "wild")
treat_wild <- list(rate = 0.03 * 0.55 * 0.2, rep = 25, treat = "treat", genotype = "wild")

lst <- list(control_mutant, treat_mutant, control_wild, treat_wild)

# set seed
set.seed(4321)

# make simulated df
simulated_df <- map(lst, ~ tibble(time = rexp(.$rep, rate = .$rate),  
                                  status = 1,                         # there is no censoring
                                  treat = .$treat, 
                                  genotype = .$genotype)) %>%   # making list of tibble
                  bind_rows()   # combine to one table

## plot K-M curve 
ggsurvplot(surv_fit(Surv(time, status) ~ treat, data = simulated_df))

and it's fail with
sort.list(y) でエラー: 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?

It looks like No.73 issue, but I cannot solve this error.
Can you advise me for this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions