Cov txheej txheem:

Muaj pes tsawg hom ntaub ntawv muaj nyob hauv R?
Muaj pes tsawg hom ntaub ntawv muaj nyob hauv R?

Video: Muaj pes tsawg hom ntaub ntawv muaj nyob hauv R?

Video: Muaj pes tsawg hom ntaub ntawv muaj nyob hauv R?
Video: Zoo Siab Nrog Koj - Paj Tsua Thoj [ Official MV ] Nkauj Tawm Tshiab 2022 2024, Kaum ib hlis
Anonim

Txhua yam hauv R yog ib yam khoom. R muaj 6 qhov yooj yim hom ntaub ntawv . (Ntxiv rau tsib lub npe hauv qab no, tseem muaj cov khoom nyoos uas yuav tsis tau tham hauv lub rooj cob qhia no.) Cov ntsiab lus ntawm cov no hom ntaub ntawv tuaj yeem muab sib xyaw ua ke cov ntaub ntawv cov qauv, xws li atomic vectors.

Ib yam li ib tug yuav nug, dab tsi yog cov ntaub ntawv atomic hauv R?

R muaj rau lub hauv paus (' atomic ') vector hom : logical, integer, tiag, complex, hlua (los yog cim) thiab raw.

Ib tug kuj yuav nug, dab tsi yog daim ntawv teev npe hauv R? R lis yog cov khoom uas muaj cov ntsiab lus ntawm ntau hom - zoo li cov hlua, lej, vectors thiab lwm yam lis hauv nws. Hauv lwm lo lus, a lis yog ib tug generic vector uas muaj lwm yam khoom. Piv txwv li: Qhov sib txawv x muaj cov ntawv luam ntawm peb vectors n, s, b thiab tus lej tus nqi 3.

Hais txog qhov no, hom ntaub ntawv twg hauv R tuaj yeem tuav ntau hom ntsiab lus?

Cov ntaub ntawv hom tuaj yeem yog tus lej, tus lej, tus cwj pwm , complex los yog logic. Lub vector hauv R programming yog tsim los ntawm c() muaj nuj nqi. Coercion yuav siv qhov chaw nyob rau hauv ib vector los ntawm qis mus rau sab saum toj, yog hais tias cov ntsiab lus dhau los ntawm cov ntaub ntawv sib txawv los ntawm Logical mus rau Integer mus rau ob npaug rau. Cim.

Dab tsi yog tsib chav kawm atomic ntawm R?

R muaj tsib theem pib lossis "atomic" chav kawm ntawm cov khoom:

  • tus cwj pwm.
  • numeric (tus lej tiag)
  • tus lej.
  • complex.
  • logical (Tseeb/False)

Pom zoo: