epicontacts
epicontacts copied to clipboard
method = 'ttree' is not available
Hi, I flow this post (https://www.reconlearn.org/post/real-time-response-3.html) and try to plot timed transmission trees using this code.
q <- plot(cons_tree, method = 'ttree', ## show timed tree x_axis = 't_inf_est', ## use 't_inf_est' column for x_axis edge_color = "support", ## color edges by posterior support edge_col_pal = support_pal, ## specify color palette node_size = 'R_i', ## node size reflects R_i ## edge_label = "support", ## not showing for readability ## node_shape = "gender", ## not showing for readability ## shapes = c(m = "male", f = "female"), ## specify shapes width = 1000, ## adjust to improve readability height = 1500, ## adjust to improve readability node_color = "outcome", ## color nodes by outcome hide_labels = TRUE, ## don't show node labels date_labels = "%d/%m", ## formatting date labels axis_type = 'double', ## show two axes col_pal = outcome_pal, ## specify color palette node_order = 'subtree_size', ## order nodes vertically by subtree size reverse_node_order = TRUE, ## put large subtrees as the bottom ttree_shape = 'branching' ## ) q
However, I only get an error: 'arg' should be one of “visNetwork”, “graph3D”, “ggplot”
. And ?vis_ttree
seems do not support too?
Here is my version:
platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 status major 4 minor 1.1 year 2021 month 08 day 10 svn rev 80725 language R version.string R version 4.1.1 (2021-08-10) package ‘epicontacts’ version 1.2.0
Hi - I think you are probably using the CRAN version, while the ttree
method is only available on the development version. You can install it with the command remotes::install_github("reconhub/epicontacts@timeline")
- let me know if that fixes the problem.
Sorry, It seems useless, I still find the error message in the console.
Error in match.arg(method) : 'arg' should be one of “visNetwork”, “graph3D”, “ggplot”
I had been reviewed the plot function and found that the method only accepts “visNetwork”, “graph3D”, “ggplot”. So I modified the method to 'visNetwork' and this fixed my issue.