Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dataset Samples
- 1 WGS nrow(WGS.ped)
- 2 WES nrow(WES.ped.exp)
- 3 MIPS nrow(MIPS.ped.exp)
- ldply(list(WGS=WGS.ped, WES=WES.ped.exp, MIPS=mips.ped.exp),
- function(l)(Samples=nrow(l)))
- .id V1
- 1 WGS 3908
- 2 WES 26367
- 3 MIPS 14193
- ldply(list(WGS=WGS.ped, WES=WES.ped.exp, MIPS=mips.ped.exp), nrow)
- .id V1
- 1 WGS 3908
- 2 WES 26367
- 3 MIPS 14193
- lapply(list(WGS=WGS.ped, WES=WES.ped.exp, MIPS=mips.ped.exp), nrow) %>%
- as.data.frame
- WGS WES MIPS
- 1 3908 26367 14193
- sapply(list(WGS=WGS.ped, WES=WES.ped.exp, MIPS=mips.ped.exp), nrow) %>%
- stack()
- values ind
- 1 3908 WGS
- 2 26367 WES
- 3 14193 MIPS
- map(list(WGS=WGS.ped, WES=WES.ped.exp, MIPS=mips.ped.exp), nrow) %>%
- as.data.frame()
- WGS WES MIPS
- 3908 26367 14193
- Dataset Samples
- WGS nrow(WGS.ped)
- WES nrow(WES.ped.exp)
- MIPS nrow(MIPS.ped.exp)
- # Load some built-in dataframes to use as an example
- df1 <- mtcars
- df2 <- iris
- df3 <- PlantGrowth
- # Build list of dataframes; use "=" so each element will be named
- df_list <- list(df1 = df1,
- df2 = df2,
- df3 = df3)
- # Calculate number of rows in each dataframe
- nrows_list <- map(df_list, nrow)
- # Create summary dataframe
- summary_df <- tibble(df = names(df_list),
- nrows = unlist(nrows_list))
- # Output
- # A tibble: 3 x 2
- df nrows
- <chr> <int>
- 1 df1 32
- 2 df2 150
- 3 df3 30
Add Comment
Please, Sign In to add comment