Age,Female,Male 0~10,5,6 11~20,15,14 21~30,20,22 31~40,25,24 41~50,25,28 51~60,30,26 61~70,20,18 71~80,15,16 81~90,10,12
Select option:
This one you selected:EarthquakeM2
研究資料的下載
圖1 作業流程圖(有向)
圖2 直條繞圓圖(有向)
圖3 桑基網絡圖(有向)
圖4 圓狀結構圖(有向)
圖5 魚骨(因果)圖(有向)
圖6 圓形包裝泡泡圖(無向)
圖7 台北捷運圖(有向)
圖8 共字(弦)圖(無向)
圖9 心智圖(有向)
圖10 Kano(狩野)圖(無向)
1.時間序列資料成2檔案(轉成關聯檔)(無向)
Mind Map(有向)
Cause Effect Diagram(有向)
Fish Bone Diagram(有向)
Fish bone diagram2(有向)
副弦:文字雲
副弦:雙軸折線直方圖
副弦:分組圓形長條圖
副弦:彩虹圓形長條圖
副弦:圓形堆積長條圖
副弦:Sankey圖
副弦:弦圖
副弦:心智圖(魚骨圖)
賀卡2025
GPT生成漫畫R碼
啤酒與尿布直接關係
FLCA啤酒與尿布直接關係
NBA All Stars List
Earthquake Country count 5.5M
@@@Earthquake Country count 5.5M
@@@自摘要取出國名
# # ================================ # Load required packages # ================================ # install.packages(c("dplyr", "purrr", "readr", "ggmap", "tidygeocoder")) library(dplyr) library(purrr) library(readr) library(ggmap) library(tidygeocoder) # ================================ # CONFIGURATION # ================================ use_google <- FALSE # Set to TRUE to use Google API; FALSE to use OpenStreetMap (free) google_api_key <- "YOUR_GOOGLE_API_KEY" # Replace with your actual Google API key # ================================ # Load earthquake dataset # ================================ df <- read_csv("F:/RR/earthquakeM.csv") # Change to your file path if needed # Filter earthquakes with magnitude ≥ 5.5 df_filtered <- df %>% filter(magnitude >= 5.5) # Sample 500 rows (you can adjust this) df_sample <- df_filtered[1:500, ] # ================================ # Geocoding section # ================================ if (use_google) { # Register Google API key register_google(key = google_api_key) # Reverse geocode using Google Maps API df_sample$full_address <- map_chr(1:nrow(df_sample), function(i) { tryCatch({ Sys.sleep(0.2) # Rate limit delay revgeocode( location = c(df_sample$longitude[i], df_sample$latitude[i]), output = "address", override_limit = TRUE ) }, error = function(e) { message(sprintf("Error at row %d: %s", i, e$message)) return(NA) }) }) # Extract country from address df_sample$country <- sapply(strsplit(df_sample$full_address, ", "), function(x) { if (is.na(x[1])) return(NA) tail(x, 1) }) } else { # Reverse geocode using OpenStreetMap via tidygeocoder df_sample <- df_sample %>% reverse_geocode(lat = latitude, long = longitude, method = 'osm', full_results = TRUE) # Extract country directly df_sample$country <- df_sample$country } # ================================ # Analyze results # ================================ # Count earthquakes by country country_counts <- df_sample %>% filter(!is.na(country)) %>% group_by(country) %>% summarise(earthquake_count = n(), .groups = "drop") %>% arrange(desc(earthquake_count)) # View top 10 countries print(head(country_counts, 20)) # Check Japan's rank japan_rank <- which(country_counts$name == "Japan") cat("Japan's rank:", japan_rank, "\n")