Это мой набор данных
dput(head(AMC))
structure(list(`NCT Number` = c("NCT03987958", "NCT02809092",
"NCT02860793", "NCT04069208", "NCT02319135", "NCT02920008"),
Status = c("Recruiting", "Active, not recruiting", "Completed",
"Recruiting", "Completed", "Completed"), `Study Results` = c("No Results Available",
"No Results Available", "No Results Available", "No Results Available",
"No Results Available", "No Results Available"), Conditions = c("Acute Myeloid Leukemia",
"Acute Myeloid Leukemia", "Acute Myeloid Leukemia", "Acute Myeloid Leukemia",
"Acute Myeloid Leukemia", "Acute Myeloid Leukemia"), Interventions = c(NA,
"Biological: NK Cells + Chemotherapy Starting", "Other: Bone marrow aspiration|Other: Blood sampling",
"Drug: Idarubicin and cytarabine induction", "Drug: Azacitadine|Drug: Fludarabine|Drug: Cytarabine|Drug: Lenograstim|Drug: Filgastrim",
"Drug: guadecitabine|Drug: Treatment Choice (TC)"), Gender = c("All",
"All", "All", "All", "All", "All"), Age = c("18 Years and older (Adult, Older Adult)",
"2 Years to 59 Years (Child, Adult)", "18 Years and older (Adult, Older Adult)",
"18 Years to 60 Years (Adult)", "65 Years and older (Older Adult)",
"18 Years and older (Adult, Older Adult)"), Phases = c(NA,
"Phase 1|Phase 2", "Not Applicable", "Phase 2", "Phase 3",
"Phase 3"), Enrollment = c(100, 30, 10, 42, 289, 302), `Study Type` = c("Observational",
"Interventional", "Interventional", "Interventional", "Interventional",
"Interventional"), `Study Designs` = c("Observational Model: Cohort|Time Perspective: Prospective",
"Allocation: N/A|Intervention Model: Single Group Assignment|Masking: None (Open Label)|Primary Purpose: Treatment",
"Allocation: N/A|Intervention Model: Single Group Assignment|Masking: None (Open Label)|Primary Purpose: Basic Science",
"Allocation: N/A|Intervention Model: Single Group Assignment|Masking: None (Open Label)|Primary Purpose: Treatment",
"Allocation: Randomized|Intervention Model: Parallel Assignment|Masking: None (Open Label)|Primary Purpose: Treatment",
"Allocation: Randomized|Intervention Model: Parallel Assignment|Masking: None (Open Label)|Primary Purpose: Treatment"
)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"
))
############################################################################
head(AMC)
# A tibble: 6 x 11
`NCT Number` Status `Study Results` Conditions Interventions Gender Age Phases Enrollment `Study Type` `Study Designs`
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
1 NCT03987958 Recruit… No Results Avai… Acute Myel… NA All 18 Year… NA 100 Observation… Observational Model: …
2 NCT02809092 Active,… No Results Avai… Acute Myel… Biological: NK Cel… All 2 Years… Phase… 30 Interventio… Allocation: N/A|Inter…
3 NCT02860793 Complet… No Results Avai… Acute Myel… Other: Bone marrow… All 18 Year… Not A… 10 Interventio… Allocation: N/A|Inter…
4 NCT04069208 Recruit… No Results Avai… Acute Myel… Drug: Idarubicin a… All 18 Year… Phase… 42 Interventio… Allocation: N/A|Inter…
5 NCT02319135 Complet… No Results Avai… Acute Myel… Drug: Azacitadine|… All 65 Year… Phase… 289 Interventio… Allocation: Randomize…
6 NCT02920008 Complet… No Results Avai… Acute Myel… Drug: guadecitabin… All 18 Year… Phase… 302 Interventio… Allocation: Randomize…
Как мне суммировать данные, оставив первый столбец отдельно, который является моей ссылкой для карты.
Если я возьму статус, пол, возраст и т. Д. Вместе, это будет просто, но столбец, который содержит вмешательства, состоит из нескольких слов вместе. Я хотел бы, чтобы это было резюмировано.
Итак, оставляя первый столбец, моя цель - увидеть сводку данных.
Как это сделать, любое предложение или помощь будут очень благодарны
Ожидаемый результат
table(AMC$Status,AMC$`Study Results`, AMC$`Study Type`)
, , = Expanded Access
Has Results No Results Available
Active, not recruiting 0 0
Approved for marketing 0 2
Available 0 3
Completed 0 0
Enrolling by invitation 0 0
No longer available 0 2
Not yet recruiting 0 0
Recruiting 0 0
Suspended 0 0
Terminated 0 0
Unknown status 0 0
Withdrawn 0 0
, , = Expanded Access:Individual Patients
Has Results No Results Available
Active, not recruiting 0 0
Approved for marketing 0 1
Available 0 2
Completed 0 0
Enrolling by invitation 0 0
No longer available 0 2
Not yet recruiting 0 0
Recruiting 0 0
Suspended 0 0
Terminated 0 0
Unknown status 0 0
Withdrawn 0 0
Вышеупомянутый мой ожидаемый результат. Но кажется, что было бы сложно поместить все переменные, кроме первой, в таблицу или одну таблицу, поскольку я вижу много уровней. Но можно ли его преобразовать в нечто более лаконичное? Вместо того, чтобы делать стол