Day2-Hector-On Basic RStudio setting

· 安装RStudio

· 安装官网

下载RStudio
https://www.rstudio.com/products/rstudio/download/

· 预防中文路径

安装Rstudio时要避免中文路径的出现,以下是一种解决方法:

win+R,输入sysdm.cpl, 高级 -> 环境变量 -> 将TEMP和TMP修改为任意不含中文的路径


配置系统环境变量

· 修改Rstudio的外观

下载完成Rstudio之后,在Tools -> Global Options -> Appearance中可以修改Rstudio的外观。



默认的参数如下:

RStudio theme -> Modern;
Zoom -> 90%;
Editor font -> Lucida Console;
Editor font size ->10;
Editor theme -> Textmate(default)

· 并行项目的工作路径设置





另外,list.files() 可以用来查看当前工作目录下的所有文件:

 list.files()
[1] "①西南交大《管理运筹学》本科期末试题与答案.pdf" 

· 删除变量

> x=1;y=2
> print(c(x,y))
[1] 1 2
> rm(y);y
Error in eval(ei, envir) : 找不到对象'y'

作图:点格局数据Spatial point patterns模拟

# simulate spatial distr. with complete spatial randomness
nind=2000 #nind stands for "numbers of individual"
dat=data.frame(x=runif(nind, min=0, max=1000),y=runif(nind, min=0, max=500)) 
# The simulational quadrat is of 1000m*500m 
# The distribution is absolutely random.

# or we can simulate some degree of aggregation
# library(mobsim)
# dat=sim_thomas_coords(nind, mother_points = 20, sigma=50, xrange = c(0,1000), yrange=c(0,500))$census

plot(dat$x, dat$y, xaxs='i',yaxs='i', xlim=c(0,1000),ylim=c(0,500))
abline(v=seq(0,1000,by=20), col='grey')
abline(h=seq(0,500,by=20), col='grey')
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容