Skip to content

Latest commit

 

History

History
88 lines (68 loc) · 3.1 KB

File metadata and controls

88 lines (68 loc) · 3.1 KB

R_Statistical_Computing_Portfolio_RubenGavidia0x.R

Linkedin Assesment badge:

image

city driving (mpg) - highway driving (mpg)

3 date-personal savings rate 4 date-median duration of unemployment, in weeks, 5 date-number of unemployed in thousands 5_1 date-number of unemployed in thousands Fuel Economy dataset count type of cars by class 1 month of data collection - total population, in thousands 2 date-personal consumption expenditures

Fuel economy data from 1999 to 2008 for 38 popular models of cars. relationship between cilinders, highway miles per gallon (effiency) and engine displacement, in litres (engine size)

image

image

#type of transmission

image

#the type of drive train, where f = front-wheel drive, r = rear wheel drive, 4 = 4wd

image

image

> x = matrix(1:9, ncol=3)
> x
     [,1] [,2] [,3]
[1,]    1    4    7
[2,]    2    5    8
[3,]    3    6    9
> t=t(x)
> t
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    5    6
[3,]    7    8    9
> det(x)
[1] 0
> det(t)
[1] 6.661338e-16
> all.equal(det(x),det(t))
[1] TRUE

> at=cbind(c(9,8,7),c(6,5,4),c(3,2,1))
> at
     [,1] [,2] [,3]
[1,]    9    6    3
[2,]    8    5    2
[3,]    7    4    1
> det(at)
[1] 0

Rcode of stackoverflow test

# empty list to start with
X <- list()
# we get a vector
v1 <- c(1, 2, 3, 4, 5)
# add it to the ragged array
X <- c(X, list(v1))
# get another couple of vectors and add them as well
v2 <- c(9, 8, 7, 6)
v3 <- c(2, 4, 6, 8)
X <- c(X, list(v2, v3))

# add some more elements to the first vector in 
# the vector directly
X[[1]] <- c(X[[1]], 4, 3, 2, 1)


rubengavidia#6305

rgavidia13@gmail.com