最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

畢業(yè)設(shè)計 醫(yī)學(xué)數(shù)據(jù)分析 猴痘疾病數(shù)據(jù)分析與可視化

2023-08-25 11:47 作者:丹成學(xué)長  | 我要投稿

0 前言

??這兩年開始畢業(yè)設(shè)計和畢業(yè)答辯的要求和難度不斷提升,傳統(tǒng)的畢設(shè)題目缺少創(chuàng)新和亮點,往往達不到畢業(yè)答辯的要求,這兩年不斷有學(xué)弟學(xué)妹告訴學(xué)長自己做的項目系統(tǒng)達不到老師的要求。

為了大家能夠順利以及最少的精力通過畢設(shè),學(xué)長分享優(yōu)質(zhì)畢業(yè)設(shè)計項目,今天要分享的是

?? 大數(shù)據(jù)醫(yī)學(xué)分析 猴痘疾病數(shù)據(jù)分析與可視化

??學(xué)長這里給一個題目綜合評分(每項滿分5分)

  • 難度系數(shù):2分

  • 工作量:2分

  • 創(chuàng)新點:4分

畢設(shè)幫助,選題指導(dǎo),技術(shù)解答,歡迎打擾,見B站個人主頁

https://space.bilibili.com/33886978

1 課題背景

猴痘的全球流行數(shù)據(jù)可視化

2 數(shù)據(jù)處理

?# 加載包
? ?library(ggplot2)
? ?library(dplyr)
? ?library(maps)
? ?library(viridis)

? ?
? ?# 讀取數(shù)據(jù) 數(shù)據(jù)集來自https://github.com/globaldothealth/monkeypox
? ?# Read worldwide case data
? ?case_series <- read.csv("/home/mw/input/monkeypot5928/timeseries-country-confirmed.csv", colClasses = c("Country" = "character")) # ,colClasses = c("Country" = "factor")
? ?head(case_series)

在這里插入圖片描述


? ?# 地圖
? ?world_map <- map_data("world")
? ?head(world_map)
? ?#表示過國家的經(jīng)緯度


讓我們定義一個具有以下特征的函數(shù): ?
輸入:日期、緯度范圍、經(jīng)度范圍 ?
輸出:所提供日期的累積事例計數(shù)地圖,以輸入的緯度和經(jīng)度值為界


? ?
? ?# 自定義函數(shù)
? ?plot_case_map <- function(date, xlim, ylim) {
? ? ?# Pre-process case and map data
? ? ?case_map <- case_series[which(case_series$Date == date), c(4, 3)]
? ? ?colnames(case_map)[1] <- "region"
? ? ?case_map$region[which(case_map$region == "United States")] <- "USA"
? ? ?case_map$region[which(case_map$region == "United Kingdom")] <- "UK"
? ? ?case_map$region[which(case_map$region == "Democratic Republic Of The Congo")] <- "Democratic Republic of the Congo"
? ? ?case_map$region[which(case_map$region == "Bosnia And Herzegovina")] <- "Bosnia and Herzegovina"
? ? ?if ("Gibraltar" %in% case_map$region) {
? ? ? ?case_map <- case_map[-which(case_map$region == "Gibraltar"), ]
? ? ?}
? ? if (length(setdiff(world_map$region, case_map$region)) > 0) {
? ? ? ?case_map_other <- as.data.frame(cbind(setdiff(world_map$region, case_map$region), NA))
? ? ? ?colnames(case_map_other) <- c("region", "Cumulative_cases")
? ? ? ?case_map <- rbind(case_map, case_map_other)
? ? ?}
? ? ?case_map$Cumulative_cases <- as.numeric(case_map$Cumulative_cases)
? ? ?case_map <- left_join(case_map, world_map, by = "region")
? ?

? ? ?# Plot case map
? ? ?ggplot(case_map, aes(long, lat, group = group)) +
? ? ? ?geom_polygon(aes(fill = Cumulative_cases), color = "white", size = 0.2) +
? ? ? ?scale_fill_viridis_c() +
? ? ? ?theme_linedraw() +
? ? ? ?theme(legend.position = "right") +
? ? ? ?labs(fill = "Cumulative cases") +
? ? ? ?theme(legend.direction = "vertical") +
? ? ? ?coord_map(xlim = xlim, ylim = ylim)
? ?}

根據(jù)函數(shù)繪制地圖

3 數(shù)據(jù)可視化

## 繪制截至2022年7月29日的世界猴痘病例地圖:
? ?plot_case_map("2022-07-29", c(-180, 180), c(-55, 90))

在這里插入圖片描述


? ?### 繪制截至2022年5月29日的世界猴痘病例地圖
? ?plot_case_map("2022-05-29", c(-180, 180), c(-55, 90))

在這里插入圖片描述


?#繪制截至2022年7月29日的猴痘病例地圖:
? ?plot_case_map("2022-07-29", c(-22, 38), c(35, 64))

在這里插入圖片描述


? #美國的猴痘病例數(shù)據(jù)來源 https://www.cdc.gov/poxvirus/monkeypox/response/2022/us-map.html
? ?us_case_map<- read.csv("/home/mw/input/monkeypot5928/Monkeypox.csv")
? ?head(us_case_map)

在這里插入圖片描述


?us_map <- map_data("state")
? ?us_case_map <- us_case_map[-which(us_case_map$State %in% c("Alaska", "Hawaii", "Puerto Rico", "Non-US Resident")), -3]
? ?colnames(us_case_map)[1] <- "region"
? ?us_case_map$region <- tolower(us_case_map$region)
? ?if (length(setdiff(us_map$region, us_case_map$region)) > 0) {
? ? ?us_case_map_other <- as.data.frame(cbind(setdiff(us_map$region, us_case_map$region), NA))
? ? ?colnames(us_case_map_other) <- c("region", "Cases")
? ? ?us_case_map <- rbind(us_case_map, us_case_map_other)
? ?}
? ?us_case_map$Cases <- as.numeric(us_case_map$Cases)
? ?us_case_map <- left_join(us_case_map, us_map, by = "region")
? ?

? ?# Plot US case map
? ?ggplot(us_case_map, aes(long, lat, group = group)) +
? ? ?geom_polygon(aes(fill = Cases), color = "white", size = 0.2) +
? ? ?scale_fill_viridis_c() +
? ? ?theme_linedraw() +
? ? ?theme(legend.position = "right") +
? ? ?labs(fill = "Total cases") +
? ? ?theme(legend.direction = "vertical")


在這里插入圖片描述

讓我們定義一個函數(shù),該函數(shù)將國家/地區(qū)名稱作為輸入并繪制:

x 軸上的日期 ? 左側(cè) Y 軸上的累積案例計數(shù)(紅色) ? 右側(cè) Y 軸上的每日案例計數(shù)(藍色)


?plot_case_series <- function(country) {
? ? ?# Plot cumulative case counts in red
? ? ?country_series <- case_series[which(case_series$Country == country), ]
? ? ?par(oma = c(1, 1, 1, 3))
? ? ?plot(country_series$Cumulative_cases, type = "l", xaxt = "n", xlab = NA, main = paste(country, "reported case time series"), ylab = "Cumulative cases", col.lab = "red", col = "red")
? ? ?axis(1, at = 1:nrow(country_series), labels = country_series$Date, las = 2, gap.axis = 1, cex.axis = 0.8)
? ?

? ? ?# Plot daily case counts in blue
? ? ?par(new = TRUE)
? ? ?plot(country_series$Cases, type = "l", axes = FALSE, xlab = NA, ylab = NA, col = "blue")
? ? ?axis(4, at = pretty(range(country_series$Cases)))
? ? ?mtext("Cases", side = 4, line = 3, col = "blue")
? ? ?grid()
? ?}

現(xiàn)在,我們可以使用此函數(shù)來探索多個國家/地區(qū)的猴痘病例趨勢:

加拿大報告病例曲線

?plot_case_series("Canada")

在這里插入圖片描述

美國病例曲線

?plot_case_series("United States")

在這里插入圖片描述

英國病例曲線

? plot_case_series("United Kingdom")

在這里插入圖片描述

畢設(shè)幫助,選題指導(dǎo),技術(shù)解答,歡迎打擾,見B站個人主頁

https://space.bilibili.com/33886978

畢業(yè)設(shè)計 醫(yī)學(xué)數(shù)據(jù)分析 猴痘疾病數(shù)據(jù)分析與可視化的評論 (共 條)

分享到微博請遵守國家法律
临高县| 霍州市| 台山市| 盐城市| 清河县| 若羌县| 格尔木市| 喀喇| 古浪县| 镇巴县| 肥西县| 化德县| 五峰| 天柱县| 溆浦县| 成武县| 佳木斯市| 马边| 洛浦县| 隆安县| 滨海县| 黎城县| 陇南市| 武冈市| 梁山县| 股票| 兴宁市| 乌拉特前旗| 那曲县| 汝阳县| 巴马| 金堂县| 肇州县| 波密县| 海宁市| 水城县| 双辽市| 十堰市| 酒泉市| 拜泉县| 嘉鱼县|