R studio界面介绍及par参数详解
生活随笔
收集整理的這篇文章主要介紹了
R studio界面介绍及par参数详解
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
本篇文章主要包含以下內(nèi)容,其中主要詳細介紹了par參數(shù)。其中par參數(shù)中的關于圖形位置參數(shù)能夠調(diào)整圖像位置,達到一張圖中顯示多張圖的效果。 1.R studio 界面 2.par參數(shù) 2.1圖形位置參數(shù) 2.2顏色設置參數(shù)(待更新) 2.3文本參數(shù)(待更新) 2.4線條符號相關參數(shù)(待更新) 1.Rstudio 界面簡介 1:R語言編寫區(qū) 在這里可以編寫語言,可以刪除,修改。選中你寫的語言,點擊上方run,會在2區(qū)看到運行結果 2:運行區(qū) 語言的運行結果,出現(xiàn)的錯誤都會在這里展現(xiàn)(不要在這里直接寫語言,因為無法編輯修改) 3:數(shù)據(jù)顯示區(qū) 顯示目前你在R里已經(jīng)輸入的元素,如數(shù)據(jù)框,因子等 4:繪圖,求助結果區(qū) export:圖片保存以及保存格式,復制。點擊里面的directory意思是可以選擇保存文件夾 1.2 R繪圖界面簡介 R的繪圖界面總共分為三部分:outer margins;figure region;polt region 通常,繪圖窗口中沒有 outer margin。標簽、軸名稱、 圖片標題是在上圖中白色區(qū)域,主要的圖形在 plot region,軸和 box 在虛線處。R 中繪圖命令分為兩種:高級——使用的時候會自動生成新窗口;低級——在當前窗口添加。 2.par的參數(shù)以及實際應用 2.1圖形位置參數(shù) par:是設置全局繪圖參數(shù)的函數(shù)添加參數(shù)no.readonly = TRUE生成一個可修改的當前圖形參數(shù)列表 ask: par(ask=TURE),產(chǎn)生新的繪圖頁面之前提示操作 new:par(new=TRUE)新圖在當前的figure region生成。par(new=FALSE),FALSE為默認值,新圖在下一個figure region生成 mfcol:? 按照列填充矩陣mfcol=c(3,2):3行2列分割圖形界面(和layout有點像) mfrow: 按照行填充圖形矩陣 mfg:A numerical vector of the form c(i, j) where i and j indicate which figure in an array of figures is to be drawn next (if setting) or is being drawn (if enquiring). The array must already have been set by mfcol or mfrow. For compatibility with S, the form c(i, j, nr, nc) is also accepted, when nr and nc should be the current number of rows and number of columns. Mismatches will be ignored, with a warning. i代表了第幾行;j代表了第幾列,nr,nc代表前面的mfcol或者mfrow #R 代碼示例 attach(mtcars) opar<-par(no.readonly = TRUE) par(mfrow=c(2,2))#圖左 #par(mfclo=c(2,2))圖右 plot(wt,mpg,main = 'Demon1') plot(wt,disp,main = 'Demon2') hist(wt,main = 'Demon3') boxplot(wt,main = 'Demon4') 結果示例: ? ? ? #R 代碼示例 #mfg attach(mtcars) opar<-par(no.readonly = FALSE) par(mfcol=c(3,2))#圖區(qū)被分成3行2列 plot(wt,mpg,main = 'Demon1')#從默認位置開始 par(mfg= c(3, 2,3,2)) plot(wt,disp,main = 'Demon2') par(mfg = c(2, 2,3,2)) hist(wt,main = 'Demon3') par(mfg = c(1, 2,3,2)) boxplot(wt,main = 'Demon4') par(mfg = c(2, 1,3,2)) boxplot(wt,main = 'Demon4') 結果示例:
轉載于:https://www.cnblogs.com/411learn-forever/p/9946421.html
總結
以上是生活随笔為你收集整理的R studio界面介绍及par参数详解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 外汇天眼:使用 MT4 进行交易的最佳方
- 下一篇: 慧编程python硬件_慧编程 mBlo