Uyifaka njani kwaye uyilayisha njani i-ggplot2 kwi-R

NguAndrie de Vries, uJoris Meys

Kubaggplot2ayiyonxalenye yosasazo oluqhelekileyo lwe-R, kuya kufuneka ukhuphele iphakheji kwi-CRAN kwaye uyifake.



Inkqubo ye- Inethiwekhi ebanzi yoVimba (I-CRAN) yinethiwekhi yamaseva kwihlabathi liphela aqukethe ikhowudi yemvelaphi, amaxwebhu, kunye nezongezo kwiipakeji zeR.



Iphakheji nganye engenisiweyo kwi-CRAN nayo inephepha elichaza ukuba iphakheji imalunga nantoni. Ungayijonga ifayile ye- ggplot2 iphepha ngolwazi oluthe kratya.

Nangona kuyinto eqhelekileyo ukuba ujonge nje kwiphakheji njengeggplpl, enyanisweni, kukuphumeza okwesibini kwegrama yemizobo yeR; yiyo loo nto iphakhejiggplot2. Ngokubhala, ingxelo yangoku yephakheji yinguqulelo engu-0.9.0.



Mhlawumbi ngokudideka, owona msebenzi ubalulekileyo kule phakheji nguggplot (). Qaphela ukuba umsebenzi awuna-2 egameni lakhe. Ke lumka ukubandakanya u-2 xafakela iipakethe ()okanyeithala lencwadi ()i iphakheji kwikhowudi yakho ye-R, kodwa i umsebenzi ggplot ()ngokwayo ayiqulathanga u-2.

Nantsi indlela yokwenza faka ipakethe okokuqala ngefakela iipakethe ()umsebenzi kunye nokulayisha iphakheji ekuqaleni kweseshoni nganye ye-R ngeithala lencwadi ()umsebenzi.

Ukufaka ifayileggplot2package, Sebenzisa oku kulandelayo:



> install.packages('ggplot2')

Kwaye ukuyilayisha, sebenzisa oku kulandelayo:

> library('ggplot2')