Otu esi etinye asụsụ mmemme R na Ubuntu 20.04

R bụ asụsụ mmemme mepere emepe, yana gburugburu sọftụwia efu maka mgbakọ mgbakọ na mwepụ na ihe ngosi eserese nke R Core Team na ndị na-akwado ya. Ntọala R. A na-eji ewu ewu R n'ọtụtụ ebe n'etiti ndị ọnụ ọgụgụ na ndị na-egwupụta data maka ndị nrụpụta ngwanrọ na nyocha data.

N'ime nkuzi na-esote, ị ga-amụta ka esi etinye R site na iji ebe nchekwa CRAN na Wụnye ngwugwu site na ebe nchekwa R's CRAN ma ọ bụ PPA cran2deb4ubuntu na Ubuntu 20.04.

Prerequisites

  • OS akwadoro: Ubuntu 20.04
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo or mgbọrọgwụ ohere.

Melite Sistemụ Ọrụ

Melite gi Ubuntu Sistemụ arụmọrụ iji hụ na ngwugwu niile dị adị adịla ugbu a:

sudo apt update && sudo apt upgrade -y

Nkuzi a ga-eji ya sudo iwu na na-eche na ị nwere ọnọdụ sudo.

Iji nyochaa ọkwa sudo na akaụntụ gị:

sudo whoami

Ihe atụ na-egosi ọkwa sudo:

[joshua@ubuntu ~]$ sudo whoami
root

Ka ịtọlite ​​akaụntụ sudo dị adị ma ọ bụ ọhụrụ, gaa na nkuzi anyị na Otu esi etinye onye ọrụ na Sudoers na Ubuntu.

Iji mgbọrọgwụ akaụntụ, jiri iwu na-esonụ na paswọọdụ mgbọrọgwụ banye.

su

Advertisement


Wụnye dabere maka R

Nke mbụ, mepee ọnụ (CTRL+ALT+T) ma wụnye ihe ndabere ndị a.

sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common

ụdị "Y", pịa pịa "Tinye igodo" ịga n'ihu na mezue nrụnye.

Bubata igodo GPG na ebe nchekwa CRAN

Site na ndabara, R dị na ebe nchekwa Ubuntu 20.04. Agbanyeghị, ọ bụ ihe ochie. A na-atụ aro ka ịwụnye R site na CRAN ebe nchekwa.

Nke mbụ, bubata igodo GPG nke achọrọ iji chọpụta izi ezi nke ngwugwu R.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

Ọmụmaatụ ma ọ bụrụ na mbubata ahụ gara nke ọma:

Otu esi etinye asụsụ mmemme R na Ubuntu 20.04

Na-esote, bubata ebe nchekwa CRAN.

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'

Ozugbo ebubatara, megharịa ndepụta nchekwa APT gị.

sudo apt update

Advertisement


Wụnye Asụsụ Mmemme R

Site na ndabere na ebe nchekwa CRAN agbakwunyere ọhụrụ arụnyere, ị nwere ike iwunye asụsụ R site na ime iwu na-esote na ọdụ gị.

sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common

Ihe atụ mmepụta:

Otu esi etinye asụsụ mmemme R na Ubuntu 20.04

Ozugbo echichi mechara, chọpụta ma ọ gara nke ọma site na ịlele ụdị nrụpụta ahụ.

R --version

Ihe atụ mmepụta:

Otu esi etinye asụsụ mmemme R na Ubuntu 20.04

Otu esi etinye ngwugwu R site na CRAN

Ugbu a arụnyere R na sistemụ gị, ị nwere ike ịmalite ihe atụ R.

N'ọnụ ọnụ gị, jiri iwu a.

sudo -i R

Ọmụmaatụ si n'ọnụ R:

Otu esi etinye asụsụ mmemme R na Ubuntu 20.04

R nwere nnukwu ngwugwu nke ị nwere ike iwunye. Maka nkuzi, na "Txtplot" ngwugwu na-eweghachi eserese ASCII “Ikpe ahịrị, ịsasa nkata, mmanya eserese, na atụmatụ njupụta." A na-etinye nke a site na iji install.ngwugwu(”) iwu na shei ọdụ R.

install.packages('txtplot')

Ihe atụ mmepụta:

Otu esi etinye asụsụ mmemme R na Ubuntu 20.04

na "atụmatụ ederede" arụnyere ugbu a, ị nwere ike ịme ule site na ịgbalite ngwugwu ahụ na ọdụ shei R.

library('txtplot')

Na-esote, egosiri ihe atụ site na iji ihe atụ data wetara site na ngwungwu “datasets” R nwere ọsọ nke ụgbọ ala na anya chọrọ ịkwụsị dabere na data sitere na 1920s:

txtplot(cars[,1], cars[,2], xlab = 'speed', ylab = 'distance')

Site na iwu ntinye a, ị ga-enweta eserese nkata.

Ihe Nlereanya:

Otu esi etinye asụsụ mmemme R na Ubuntu 20.04

Na mgbakwunye, iji nweta enyemaka na ngwugwu arụnyere, ị nwere ike iji iwu na-esonụ.

help(package name)

Dochie "aha ngwugwu" na ngwugwu arụnyere. N'ihe gbasara nkuzi, nke a bụ "txtplot".

Ihe Nlereanya:

help(txtplot)

Iji wepu ngwugwu, ma ọ bụ "Txtplot" jiri iwu wepụ iwu na ọdụ R shell.

remove.packages('txtplot')

Ka ịpụ na interface ọnụ shei R, jiri ya "q()" iwu.

q()

Ị ga-ahụ ngwa ngwa:

Save workspace image? [y/n/c]: 

Họrọ nhọrọ gị ịpụ site na ịpị y, n, or c na ịpị "Tinye igodo".


Advertisement


Otu esi etinye ngwugwu R site na cran2deb4ubuntu

Nhọrọ, ị nwere ike iwunye ihe ndị a PPA cran2deb4ubuntu, PPA maka ngwugwu R sitere na Nlele Ọrụ CRAN wuru megide R 4.0 (na mwepụta ndị na-esote). Rịba ama na PPA a na-arụ ọrụ naanị maka mwepụta LTS dị ka 18.04, 20.04, na 22.04 LTS na-abịanụ mana ejiri ụdị R ọhụrụ wuo ya.

Nke mbụ, wụnye PPA site na iji iwu a.

sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+ -y

Ozugbo arụnyere, melite ndepụta nchekwa APT.

sudo apt update

Mara, ị nwere ike ịhụ ngwungwu emelitere, kwalite ka okwesịrị.

sudo apt upgrade

Kama ịchịkọta ngwugwu R, nke a nwere ike dabara onye nrụpụta, ma ị nwere ike ịwụnye ha dị ka ngwugwu Debian site na PPA. Agbanyeghị, ị ga-adabere na PPA ka edobe ma chekwaa gị.

N'ozuzu, PPA site na Otu "cran2deb4ubuntu Build Team". a maara nke ọma ma nwee ike ịtụkwasị obi.

Okwu na mmechi

N'ime nkuzi a, ị mụtala ka esi etinye R na Ubuntu 20.04 LTS Focal Fossa site na iji ebe nchekwa CRAN, nke ị nwere ike ịdọrọ na ngwugwu na mmelite ugboro ugboro.

Otu n'ime akụkụ kachasị mma banyere R mmemme bụ na ọ bụ ngwa ngwa nke obodo na-arụ, nke pụtara na onye ọ bụla nwere ike ịnye nkwalite koodu na ngwugwu ọhụrụ. Nkwekọrịta na gburugburu obodo R bụ ihe akaebe maka ụzọ a iji mepụta ngwa ngwa kpọmkwem site na ịkekọrịta na agbamume ntinye. Ngwá ọrụ a dakọtara n'ofe nyiwe, ma si otú a na-arụ ọrụ n'ọtụtụ sistemụ yana ngwaike.

Na mgbakwunye, ị nwere ike ịhụ ngwungwu R ndị ọzọ na Ngwungwu CRAN dị n'aha.

Idenye aha
Gwa nke
0 Comments
Inline nzaghachi
Lee echiche niile
0
Ga-ahụ n'anya gị echiche, biko okwu.x