博文

目前显示的是 二月, 2024的博文

naniar 缺失值

  library ( naniar ) remotes :: install_github ( "njtierney/naniar" ) airquality %>% group_by ( Month ) %>% naniar :: miss_var_summary ( ) ggplot ( data = airquality , aes ( x = Ozone , y = Solar.R ) ) + geom_miss_point ( )

ggthemr包

library ( ggthemr ) ## devtools::install_github('cttobin/ggthemr') ggthemr ( "light" ) mtcars %>% mutate ( cyl = factor ( cyl ) ) %>% ggplot ( aes ( x = mpg , fill = cyl , colour = cyl ) ) + geom_density ( alpha = 0.75 ) + labs ( fill = "Cylinders" , colour = "Cylinders" , x = "MPG" , y = "Density" ) + legend_top ( ) ggthemr_reset ( )

huxtable 做表

  library ( huxtable ) table1 <- cbind.data.frame ( mod $ mchoice , mod2 $ mchoice ) table1 %>%   as_hux ( add_colnames = FALSE ) %>%   set_number_format ( 2 )     %>%   map_text_color ( by_cols ( "darkred" , "blue" , "darkgreen" )) %>%   add_colnames ( "Criteria" ) %>%   set_header_rows ( 1 , TRUE ) %>%   add_rownames () %>%   set_bottom_border ( row = c ( 1 , 7 ), col = everywhere ) %>%   set_top_border ( row = 1 , col = everywhere ) %>%   set_bold ( 1 , everywhere ) %>%   style_headers ( bold = TRUE , text_color = "red" ) %>%   set_caption ( '(#tab:mchoicenyspatial) Model choice criteria for various models fitted to the nyspatial data set.' )

inla 发生Error “dsparseModelMatrix” object: superclass "xMatrix" not defined错误

  在从Matrix < 1.6-2切换到Matrix >= 1.6-2之后,您必须从源代码重新安装MatrixModels。 install.packages ( "MatrixModels" , type = "source" )