I am having difficulty with creating multiple heatmaps with the ComplexHeatmap package. When I run a script that contains code exactly lifted from the documentation (https://bioconductor.org/packages/release/bioc/vignettes/ComplexHeatmap/inst/doc/s3.a_list_of_heatmaps.html)...
... I get the error message:
Here is the output of sessionInfo():
R version 3.3.2 (2016-10-31) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS Sierra 10.12.2 locale:  en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8 attached base packages:  grid stats graphics grDevices utils datasets base other attached packages:  ComplexHeatmap_1.12.0 loaded via a namespace (and not attached):  flexmix_2.3-13 Rcpp_0.12.9 cluster_2.0.5  whisker_0.3-2 magrittr_1.5 fpc_2.1-10  MASS_7.3-45 munsell_0.4.3 mclust_5.2.1  colorspace_1.3-2 lattice_0.20-34 rjson_0.2.15  plyr_1.8.4 prabclus_2.2-6 tools_3.3.2  nnet_7.3-12 gtable_0.2.0 circlize_0.3.9  class_7.3-14 modeltools_0.2-21 lazyeval_0.2.0  assertthat_0.1 tibble_1.2 kernlab_0.9-25  trimcluster_0.1-2 RColorBrewer_1.1-2 ggplot2_2.2.1  GlobalOptions_0.0.10 dendextend_1.3.0 robustbase_0.92-7  shape_1.4.2 DEoptimR_1.0-8 methods_3.3.2  scales_0.4.1 diptest_0.75-7 stats4_3.3.2  mvtnorm_1.0-5 GetoptLong_0.1.5
OK, this seems very strange. I was previously running the code I posted using Rscript, and it gives the indicated error. But when I run R interactively and copy-and-paste those lines in, it does work (with or without --vanilla). It does NOT work via Rscript whether with or without --vanilla.
EDIT: I did some Googling and it was suggested to say library(methods) at the top of the script (apparently R attaches this by default, but not Rscript). This made it work in Rscript!
I can't reproduce. You might try restarting R and re-running your code, particularly with R --vanilla to get a clean workspace on startup. If you still get an error, please show the results from