摘要:ref: R语言——日期时间处理 ref: as.Date: Date Conversion Functions to and from Character ref: Date Formats in R as.Date()it can change a normal string into a da
阅读全文
摘要:Ref: ggplot2 title : main, axis and legend titles Ref: ggplot2 标题居中 Ref: ggplot的3种去掉图例的方法 (theme(legend.position="none")) Ref: R绘图:一文了解ggplot2颜色的设置 Re
阅读全文
摘要:Ref: R 字符串 Ref: R语言遍历文件和批量输出文件 setwd(dir)getwd()getwd returns an absolute filepath representing the current working directory of the R process; setwd(
阅读全文
摘要:ref: tm_polygons: Draw polygons Arguments alpha transparency number between 0 (totally transparent) and 1 (not transparent). By default, the alpha val
阅读全文
摘要:ref: Add Leading Zeros to the Elements of a Vector in R 参考代码: # 数组 > seq(12) [1] 1 2 3 4 5 6 7 8 9 10 11 12 # 格式化打印,自动补零 > sprintf("%02d", seq(12)) [1
阅读全文
摘要:ref: palette_explorer: Explore color palettes palette_explorer() starts an interactive tool shows all Color Brewer and viridis palettes, where the num
阅读全文
摘要:ref: [R字符串] 字符串长度、分割、拼接、截取、替代、匹配和大小写替换 ref: R String Manipulation Functions 1. nchar() With the help of this function, we can count the characters. Th
阅读全文
摘要:ref: R语言data.frame常用操作 ref: Keep rows that match a condition The filter() function is used to subset a data frame, retaining all rows that satisfy you
阅读全文
摘要:参考:case_when: A general vectorised if Others 用 TRUE 表示,举例如下: x <- 1:50 case_when( x %% 35 == 0 ~ "fizz buzz", x %% 5 == 0 ~ "fizz", x %% 7 == 0 ~ "buz
阅读全文
摘要:参考:How to Use R and Python Together? Try These 2 Packages 实现功能:在 Python 代码中运行 R 文件,得到结果再在 Python 里面操作! import subprocess res = subprocess.call("Rscrip
阅读全文
摘要:参考:PySe-023-pandas.read_csv 读取 csv 文件,指定列数据类型 解决字符串数据列变为数字的问题 参考:Read a delimited file (including CSV and TSV) into a tibble Python:根据具体的列名指定数据格式 impo
阅读全文
摘要:参考:Emerging Hot Spot Analysis(前半部分是static hotspot analysis) 参考:dplyr 说明文档 运行例子里面的数据集可以,但是自己的数据集死活不行,开始以为是数据的问题,也就是计算中出错,各种修改数据都是无法运行,后面我就想,我制作一个跟例子数据集
阅读全文
摘要:参考:rpy2 学习笔记 参考:在python中使用R|rpy2
阅读全文
摘要:Ref: Emerging Hot Spot Analysis Ref: Ref: Static hotspot analysis library (tidyverse) library (sf) library (openxlsx) library (ggplot2) library (tmap)
阅读全文
摘要:Ref: How to write to CSV in R without index? Using row.names to indicate if indice are kept or not. write.csv(data,"data.csv", row.names = FALSE)
阅读全文
摘要:参考:R语言提取数据框data.frame的行名和列名 参考:R Data.frame 删除某一列 参考:R-按照行名或列名删除对应的行列 参考:R语言data.frame的常用操作总结 1. 获取所有行和所有列信息 R语言中很多数据是data.frame的形式,在数据矩阵的基础上,上边加一行表示各
阅读全文
摘要:参考:Emerging Hot Spot Analysis(前半部分是static hotspot analysis) 参考:dplyr 说明文档 代码: library (sfdep) library (dplyr) # %>% is the same as |> # guerry is a da
阅读全文
摘要:参考:R语言 mutate()实例讲解 参考:R dplyr 函数介绍之 mutate(), transmute() %>%是tidyverse包里面用来进行管道化操作的函数。 mutate()用来增加新的列,新增列通常在原数据框的最后面。 transmute()函数用来仅仅保存新增的列。 muta
阅读全文
摘要:参考:How to shutdown jupyter notebook app (server) without using ctrl-c? 下面是实际运行的两个版本的jupyter notebook 【1】http://localhost:8888/tree/Python_Task4/02_AOI
阅读全文