weiwei-

- 23 天前
- 注册于 2024年11月13日
IRONAnthony 跟着你的,我也绘制了湖南地图
安装并加载必要的包
install.packages("mapchina") # 如果尚未安装
install.packages("tidyverse") # 如果尚未安装
install.packages("sf") # 如果尚未安装library(mapchina)
library(tidyverse)
library(sf)假设 'china' 是一个包含中国各省、市、县的sf对象
过滤出湖南省的数据
province <- china %>%
filter(Name_Province == "湖南省") # 仅选择湖南省计算城市和县的几何体
cities <- province %>%
group_by(Name_Perfecture) %>%
summarise(geometry = st_union(geometry))countries <- province %>%
group_by(Name_County) %>%
summarise(geometry = st_union(geometry))绘制湖南省的地图
ggplot() +
geom_sf(data = countries,
aes(fill = factor(generate_map_colors(countries))),
linetype = "solid", size = 0.5) +
scale_fill_brewer(palette = "Pastel1") +
geom_sf(data = province, alpha = 0, linetype = "dashed", size = 0.2) +
geom_sf(data = cities, alpha = 0, linetype = "solid", size = 1.2) +
geom_sf_label(data = countries, aes(label = Name_County), size = 2.3) +
theme_bw() +
theme(legend.position = "none")if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")BiocManager::install("clusterProfiler")
在最后出现了:
安装源码包‘GenomeInfoDbData’, ‘GO.db’试开URL’https://bioconductor.org/packages/3.20/data/annotation/src/contrib/GenomeInfoDbData_1.2.13.tar.gz'
Content type 'application/x-gzip' length 12924272 bytes (12.3 MB)
downloaded 12.3 MB试开URL’https://bioconductor.org/packages/3.20/data/annotation/src/contrib/GO.db_3.20.0.tar.gz'
Content type 'application/x-gzip' length 26341489 bytes (25.1 MB)
downloaded 25.1 MBError: object 'myPaths' not found
Execution halted
Error: object 'myPaths' not found
Execution halted下载的程序包在
‘C:\Users\Administrator\AppData\Local\Temp\RtmpW4hkqy\downloaded_packages’里
警告信息:
1: In install.packages(...) :
安装程序包‘GenomeInfoDbData’时退出狀態的值不是0
2: In install.packages(...) : 安装程序包‘GO.db’时退出狀態的值不是0if(!require(dplyr)){install.packages("dplyr")}
if(!require(openxlsx)){install.packages("openxlsx")}
if(!require(data.table)){install.packages("data.table")}
if(!require(VennDiagram)){install.packages("VennDiagram,dependencies = TRUE")}
#定义组对比的结果文件名
sam1 <- "GSE106475.txt.tsv"
sam2 <- "GSE264558.txt.tsv"
outVenn <- "sleep_infection"
outXlsx <- "sleep_infections"
fc.cutoff <- 2
fdr.cutoff <- 0.05install.packages("jsonlite",type = "source")
试开URL’https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/jsonlite_1.8.9.tar.gz'
Content type 'application/octet-stream' length 1055633 bytes (1.0 MB)
downloaded 1.0 MBError: object 'myPaths' not found
Execution halted
Warning in install.packages :
安装程序包‘jsonlite’时退出狀態的值不是0下载的程序包在
‘C:\Users\Administrator\AppData\Local\Temp\Rtmpwn0jWR\downloaded_packages’里