Closed shntnu closed 9 years ago
Can you try against the dev version please.
I get consistent results from the dev version.
> featdata1 <- readRDS( "/tmp/featdata1.rds")
>
>
> featdata1 %>% dplyr::summarise_each(funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
> featdata1 %>% dplyr::summarise_each(funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
> featdata1 %>% dplyr::summarise_each(funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
> featdata1 %>% dplyr::summarise_each(funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
> featdata1 %>% dplyr::summarise_each(funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
Please try the dev version and reopen if you still have the problem.
Works now, thanks!
> featdata1 %>% dplyr::summarise_each(dplyr::funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
> featdata1 %>% dplyr::summarise_each(dplyr::funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
> featdata1 %>% dplyr::summarise_each(dplyr::funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
feat value
1380 Cytoplasm_RadialDistribution_FracAtD_RNA_4of4 4.832181e-15
1381 Nuclei_Texture_Entropy_DNA_10_0 4.877080e-15
1382 Nuclei_Texture_SumEntropy_DNA_3_0 6.090831e-15
1383 Cells_AreaShape_Extent 7.359503e-15
1384 Cytoplasm_RadialDistribution_MeanFrac_RNA_4of4 8.155040e-15
1385 Nuclei_RadialDistribution_MeanFrac_RNA_3of4 1.300921e-14
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] magrittr_1.5
loaded via a namespace (and not attached):
[1] plyr_1.8.3 lazyeval_0.1.10.9000 R6_2.1.1 assertthat_0.1 parallel_3.2.1 DBI_0.3.1 tools_3.2.1
[8] reshape2_1.4.1 dplyr_0.4.2.9002 Rcpp_0.12.0 stringi_0.5-5 stringr_1.0.0 tidyr_0.2.0
@romainfrancois another odd behavior, this time with mutate_each
, possibly related?
wrapping featdata
as a tbl_df
seems to fix the problem
> featdata1 %>% dplyr::tbl_df() %>% dplyr::mutate_each(dplyr::funs(scale)) %>% dplyr::summarise_each(dplyr::funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
Source: local data frame [6 x 2]
feat value
1 Cells_Neighbors_AngleBetweenNeighbors_Adjacent 0.2758451
2 Cells_Texture_SumEntropy_RNA_5_0 0.2801385
3 Cells_Texture_InfoMeas1_DNA_10_0 0.2829963
4 Cytoplasm_Texture_SumEntropy_RNA_3_0 0.2975776
5 Cytoplasm_Texture_InfoMeas1_ER_10_0 0.3183102
6 Cytoplasm_Texture_InfoMeas1_DNA_10_0 0.3569359
> featdata1 %>% dplyr::mutate_each(dplyr::funs(scale)) %>% dplyr::summarise_each(dplyr::funs(median)) %>% tidyr::gather(feat, value) %>% dplyr::arrange(value) %>% tail()
Error: data_frames can only contain 1d atomic vectors and lists
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] magrittr_1.5
loaded via a namespace (and not attached):
[1] plyr_1.8.3 lazyeval_0.1.10.9000 R6_2.1.1 assertthat_0.1 parallel_3.2.1 DBI_0.3.1 tools_3.2.1
[8] reshape2_1.4.1 dplyr_0.4.2.9002 Rcpp_0.12.0 stringi_0.5-5 stringr_1.0.0 tidyr_0.2.0
>
@romainfrancois Another instance of the same problem:
> featdata1 %>% dplyr::select(1:2) %>% dplyr::mutate_each(dplyr::funs(scale)) %>% dplyr::summarise_each(dplyr::funs(median))
Error: data_frames can only contain 1d atomic vectors and lists
> featdata1 %>% dplyr::select(1:2) %>% dplyr::mutate_each(dplyr::funs(scale)) %>% {plyr::colwise(median)(.)}
Nuclei_Texture_InverseDifferenceMoment_Mito_5_0 Cytoplasm_Intensity_MADIntensity_Mito
1 0.07450019 -0.1938028
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] magrittr_1.5
loaded via a namespace (and not attached):
[1] plyr_1.8.3 lazyeval_0.1.10.9000 R6_2.1.1 assertthat_0.1 parallel_3.2.1 DBI_0.3.1 tools_3.2.1 dplyr_0.4.2.9002
[9] Rcpp_0.12.0
scale()
makes a matrix...
@hadley I missed that - thanks! This makes a case for using dplyr::tbl_df for more than just pretty printing? (Note that tbl_df(featdata1)
instead of just featdata1
makes it ok to use scale
in the way I have above)
Get
featdata1
from here to reproduce this result: featdata1.rds