0% found this document useful (0 votes)
5 views2 pages

Combining Vectors and Basic R Functions

The document provides examples of basic R functions for creating vectors, combining vectors, generating sequences of numbers, and reading in data files. Some key functions mentioned are c() for creating vectors, seq() for generating sequences, read.table() for reading data files, and sum(), mean(), plot(), and hist() for summarizing and visualizing data.

Uploaded by

Emilia Burlacu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Combining Vectors and Basic R Functions

The document provides examples of basic R functions for creating vectors, combining vectors, generating sequences of numbers, and reading in data files. Some key functions mentioned are c() for creating vectors, seq() for generating sequences, read.table() for reading data files, and sum(), mean(), plot(), and hist() for summarizing and visualizing data.

Uploaded by

Emilia Burlacu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Basic R functions:

X<-c(1,2,3,4) creeare vector x

y<-c(5,6,7, ) creeare vector y

combine <-c(x,y) co!"inarea vectori#or x si y

seq(1: ) afisarea nu!ere#or ince$an% %e #a 1 si a%unan% &1

seq(1, ,1) afisarea nu!ere#or $are %e #a 1 #a ' 1,8,1 1&1(2($ar)

seq(1, ,2) afisarea nu!ere#or i!$are %e #a 1 #a ' 1,8,2 1&2(3(i!$ar)

)re*atirea fisieru#ui $entru $re#ucrare in R:

+e ia ta"e#u# si se %esc,i%e cu -.%it, tot ce este in afara ta"e#u#ui se ster*e si fisieru# se sa#vea/a ca 0nu![Link] in fo#%eru# %e #ucru2 .xe!$#u: 0nu!e12%at ( ave! fisieru# [Link], se executa: cd Download se sc,i!"a %irectoru# %e #ucru R dan<-[Link]([Link],header=T,fill=T) se citeste ta"e#u# names(dan) se afisea/a ,ea%eru# 3unctii: sum(dan !,"#,dan ",$#) su!a a 2 co#oane, 42,35 2(ran%, 3(co#oana %lot(dan !,"#,dan ",$#) afisarea *raficu#ui hist(dan ,"#) afisarea ,isto*ra!ei, 4,25 2(nu!aru# co#oanei %rint(dan&numele coloanei) afisarea va#ori#or unei co#oane mean(dan&numele coloanei) afisarea !e%iei arit!etice

You might also like