You are on page 1of 98

Allan Rigoberto Pérez Huezo

TAREA 1A

Expresión Descripción Resultado

x<-norm(50) Despliega diferentes valores [1] -2.645231956 1.023113831


x aleatorios a la variable “x” dentro [3] -0.007387386 1.037574283
del rango [1:50]. [5] -0.569762698 -0.214797201
[7] 0.688436135 -0.341274676
[9] 0.455717583 -0.876659800
[11] -0.842853653 -1.691544239
[13] 0.735207879 0.539287937
[15] 0.646406935 1.128204015
[17] -0.274728126 -1.016298011
[19] -0.345848573 -0.330711957
[21] 0.359614722 -0.275387215
[23] -0.096222180 -1.790772006
[25] 0.219252142 -0.454480725
[27] 1.522690986 0.165640182
[29] 1.523344104 -1.378970980
[31] 0.306286783 -0.972153191
[33] -0.534649488 0.574027411
[35] 0.235553129 1.092565570
[37] 0.958929874 -0.477902835
[39] 1.376611509 0.924168084
[41] -0.191885464 0.651117550
[43] 0.918313965 1.636587985
[45] 1.441603745 -0.539050941
[47] 0.817946728 1.812076901
[49] 1.310637399 0.116514080
y<-rnorm(x) Despliega diferentes valores [1] 0.49292288 0.23102913
y aleatorios a la variable “y” [3] -0.33193375 0.06550023
referenciado a “x” dentro del [5] -0.36487527 -0.18575284
rango [1:50]. [7] 1.21030786 0.96098671
[9] -0.30601390 -0.17137891
[11] -0.21200639 -1.40142554
[13] -0.32560529 0.19430311
[15] -0.38095234 2.01551595
[17] -0.19818045 0.17995259
[19] -0.38827418 -0.23640990
[21] -0.78230902 -0.12165788
[23] 1.08220562 1.87488993
[25] 1.44841841 1.18763821
[27] 1.10407054 1.15768540
[29] 0.60899326 0.35958920
[31] -0.42665461 -1.15599916
[33] 2.40901153 -0.58573364
[35] -0.53078486 1.08309228
[37] 0.26569857 1.38045372
[39] -0.25264453 1.75112239
[41] 0.40144955 0.29773583
[43] -0.39017685 1.02492759
[45] -2.36047571 -1.49205949
[47] -0.83635582 -0.39619500
[49] 0.16427888 0.40798437

plot(x,y) Permite graficar los puntos en el


plano cartesiano.

ls() Permite conocer cuales son los R [1] "x" "y"


objetos que están activos en el R
“workspace” (espacio de trabajo)
rm(x,y) Permite eliminar objetos o function (..., list = character(), pos = -1, envir =
variables que ya no se necesitan. as.environment(pos),
inherits = FALSE)
{
dots <- match.call(expand.dots = FALSE)$...
if (length(dots) && !all(vapply(dots,
function(x) is.symbol(x) ||
is.character(x), NA, USE.NAMES =
FALSE)))
stop("... must contain names or character
strings")
names <- vapply(dots, as.character, "")
if (length(names) == 0L)
names <- character()
list <- .Primitive("c")(list, names)
.Internal(remove(list, envir, inherits))
}
<bytecode: 0x103724a40>
<environment: namespace:base>
x<-1:20 Asigna valores a la variable “x” [1] 1 2 3 4 5 6 7 8 9 10 11
x del 1 al 20 [12] 12 13 14 15 16 17 18 19 20

Se despliega un vector de “peso” [1] 1.500000 1.707107 1.866025


>w<-1+sqrt(x)/2 de desviación estándar. También [4] 2.000000 2.118034 2.224745
toma como referencia la variable [7] 2.322876 2.414214 2.500000
>w “x” [10] 2.581139 2.658312 2.732051
[13] 2.802776 2.870829 2.936492
[16] 3.000000 3.061553 3.121320
[19] 3.179449 3.236068
>dummy<- Se genera un marco de datos de x y
data.frame(x=x,y= dos columnas con las variables 1 1 2.065788
x+rnorm(x)*w) “x” y “y”. 2 2 1.726779
3 3 1.617631
>dummy 4 4 1.789889
5 5 6.599248
6 6 5.204653
7 7 9.302932
8 8 5.993352
9 9 5.305148
10 10 9.803130
11 11 6.814236
12 12 10.800572
13 13 9.016666
14 14 14.155604
15 15 14.902187
16 16 18.365212
17 17 16.603298
18 18 15.965012
19 19 20.230222
20 20 19.817194
> fm<- Permite ajustar una regresión Call:
lm(y~x,data=dum lineal simple. Con “y” a la lm(formula = y ~ x, data = dummy)
my) izquierda de la tilde, se modela
“y”, que a su vez dependemos de Residuals:
x. Min 1Q Median 3Q
> summary(fm) -3.4930 -1.3177 0.3527 1.0775
Max
3.0244

Coefficients:
Estimate Std. Error
(Intercept) -0.76638 0.92127
x 1.00670 0.07691
t value Pr(>|t|)
(Intercept) -0.832 0.416
x 13.090 1.23e-10 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05
‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.983 on 18 degrees of


freedom
Multiple R-squared: 0.9049, Adjusted R-
squared: 0.8997
F-statistic: 171.3 on 1 and 18 DF, p-value: 1.23e-
10
>fm1<-lm(y~x, Al conocer las desviaciones Call:
data=dummy, estándar, se hace una regresión lm(formula = y ~ x, data = dummy, weights =
weight=1/w^2) ponderada. 1/w^2)

>summary(fm1) Weighted Residuals:


Min 1Q Median 3Q
-1.3136 -0.5518 0.1063 0.4289
Max
1.2221

Coefficients:
Estimate Std. Error
(Intercept) -0.25977 0.72069
x 0.96055 0.07349
t value Pr(>|t|)
(Intercept) -0.36 0.723
x 13.07 1.26e-10 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05
‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.7964 on 18 degrees of


freedom
Multiple R-squared: 0.9047, Adjusted R-
squared: 0.8994
F-statistic: 170.9 on 1 and 18 DF, p-value:
1.259e-10

>attach(dummy) Hace que las columnas en el The following object is masked _by_ .GlobalEnv:
“data frame” (marco de datos)
sean visibles como variables. x

The following objects are masked from dummy


(pos = 3):

x, y
>lrf<-lowess(x,y) Permite hacer una función de
>lrf regresión local no paramétrica, $x
separando valores de “x” y “y”. [1] 1 2 3 4 5 6 7 8 9 10 11
[12] 12 13 14 15 16 17 18 19 20

$y
[1] 1.155135 1.975490 2.787105
[4] 3.579131 4.350003 5.123139
[7] 5.978740 6.792263 7.521044
[10] 8.280451 9.247565 10.455603
[13] 11.788502 13.079338 14.302887
[16] 15.546021 16.792003 18.020414
[19] 19.225475 20.411670
>plot(x, y) Permite visualizar un grafico de
puntos estandar, utilizando las
variables “x” y “y”.

>lines(x, lrf$y) Dibuja una linea conectando los


puntos del grafico que se
desplegó de la función anterior.

>abline(0, 1, lty=3) Traza una linea punteada


indicando la verdadera linea de
regresión de interseccion 0,
pendiente 1)
>abline(coef(fm)) Se obtiene una linea de regresión
no ponderada.

>abline(coef(fm1), Se hace roja la línea de regresión


col=”red”) ponderada.

>detach() Se elimina el marco de datos de


la ruta de búsqueda
plot(fitted(fm), Se genera un gráfico de
resid(fm), diagnostico de regresión estándar
xlab="Fitted para verificar la
values", heterocedasticidad en los datos.
ylab="Residuals",
main="Residuals
vs Fitted")

>qqnorm(resid(fm) Genera un grafico de


, main=”Residuals puntuaciones normales que
Rankit Plot”) verifica la asimetría, curtosis y
valores atípicos.

>rm(fm,fm1,lrf,x,d Elimina los valores de las


ummy) variables dentro del paréntesis
>filepath<- Se consigue la ruta al archive de [1]
system.file(“data”,” datos con el valor “filepath” "/Library/Frameworks/R.framework/Resources/li
morley.tab”,packag brary/datasets/data/morley.tab"
e=”datasets”)

>filepath
>file.show(filepath Permite visualizar el archivo de Expt Run Speed
) datos. 001 1 1 850
002 1 2 740
003 1 3 900
004 1 4 1070
005 1 5 930
006 1 6 850
007 1 7 950
008 1 8 980
009 1 9 980
010 1 10 880
011 1 11 1000
012 1 12 980
013 1 13 930
014 1 14 650
015 1 15 760
016 1 16 810
017 1 17 1000
018 1 18 1000
019 1 19 960
020 1 20 960
021 2 1 960
022 2 2 940
023 2 3 960
024 2 4 940
025 2 5 880
026 2 6 800
027 2 7 850
028 2 8 880
029 2 9 900
030 2 10 840
031 2 11 830
032 2 12 790
033 2 13 810
034 2 14 880
035 2 15 880
036 2 16 830
037 2 17 800
038 2 18 790
039 2 19 760
040 2 20 800
041 3 1 880
042 3 2 880
043 3 3 880
044 3 4 860
045 3 5 720
046 3 6 720
047 3 7 620
048 3 8 860
049 3 9 970
050 3 10 950
051 3 11 880
052 3 12 910
053 3 13 850
054 3 14 870
055 3 15 840
056 3 16 840
057 3 17 850
058 3 18 840
059 3 19 840
060 3 20 840
061 4 1 890
062 4 2 810
063 4 3 810
064 4 4 820
065 4 5 800
066 4 6 770
067 4 7 760
068 4 8 740
069 4 9 750
070 4 10 760
071 4 11 910
072 4 12 920
073 4 13 890
074 4 14 860
075 4 15 880
076 4 16 720
077 4 17 840
078 4 18 850
079 4 19 850
080 4 20 780
081 5 1 890
082 5 2 840
083 5 3 780
084 5 4 810
085 5 5 760
086 5 6 810
087 5 7 790
088 5 8 810
089 5 9 820
090 5 10 850
091 5 11 870
092 5 12 870
093 5 13 810
094 5 14 740
095 5 15 810
096 5 16 940
097 5 17 950
098 5 18 800
099 5 19 810
100 5 20 870

>mm<- Se despliega en la consola el Expt Run Speed


read.table(filepath) archivo de datos. 001 1 1 850
002 1 2 740
>mm 003 1 3 900
004 1 4 1070
005 1 5 930
006 1 6 850
007 1 7 950
008 1 8 980
009 1 9 980
010 1 10 880
011 1 11 1000
012 1 12 980
013 1 13 930
014 1 14 650
015 1 15 760
016 1 16 810
017 1 17 1000
018 1 18 1000
019 1 19 960
020 1 20 960
021 2 1 960
022 2 2 940
023 2 3 960
024 2 4 940
025 2 5 880
026 2 6 800
027 2 7 850
028 2 8 880
029 2 9 900
030 2 10 840
031 2 11 830
032 2 12 790
033 2 13 810
034 2 14 880
035 2 15 880
036 2 16 830
037 2 17 800
038 2 18 790
039 2 19 760
040 2 20 800
041 3 1 880
042 3 2 880
043 3 3 880
044 3 4 860
045 3 5 720
046 3 6 720
047 3 7 620
048 3 8 860
049 3 9 970
050 3 10 950
051 3 11 880
052 3 12 910
053 3 13 850
054 3 14 870
055 3 15 840
056 3 16 840
057 3 17 850
058 3 18 840
059 3 19 840
060 3 20 840
061 4 1 890
062 4 2 810
063 4 3 810
064 4 4 820
065 4 5 800
066 4 6 770
067 4 7 760
068 4 8 740
069 4 9 750
070 4 10 760
071 4 11 910
072 4 12 920
073 4 13 890
074 4 14 860
075 4 15 880
076 4 16 720
077 4 17 840
078 4 18 850
079 4 19 850
080 4 20 780
081 5 1 890
082 5 2 840
083 5 3 780
084 5 4 810
085 5 5 760
086 5 6 810
087 5 7 790
088 5 8 810
089 5 9 820
090 5 10 850
091 5 11 870
092 5 12 870
093 5 13 810
094 5 14 740
095 5 15 810
096 5 16 940
097 5 17 950
098 5 18 800
099 5 19 810
100 5 20 870
>mm$Expt<- Se convierten las variables
factor(mm$Expt) “Expt” y “Run” a factores. [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[18] 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2
>mm$Expt [35] 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
[52] 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4
[69] 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5
[86] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
Levels: 1 2 3 4 5

>mm$Run<- [1] 1 2 3 4 5 6 7 8 9 10 11
factor(mm$Run) [12] 12 13 14 15 16 17 18 19 20 1 2
[23] 3 4 5 6 7 8 9 10 11 12 13
>mm$Run [34] 14 15 16 17 18 19 20 1 2 3 4
[45] 5 6 7 8 9 10 11 12 13 14 15
[56] 16 17 18 19 20 1 2 3 4 5 6
[67] 7 8 9 10 11 12 13 14 15 16 17
[78] 18 19 20 1 2 3 4 5 6 7 8
[89] 9 10 11 12 13 14 15 16 17 18 19
[100] 20
20 Levels: 1 2 3 4 5 6 7 8 9 10 ... 20
>attach(mm) Hace visible el marco de datos en
la posición 3 ( el valor por
defecto)
>plot(Expt, Speed, Se comparan los cinco elementos
main=”Speed of con simples diagramas de caja.
Light Data”,
xlab=”Experiment
No.”)

>fm<- Se analiza como un bloque Run 19 113344 5965 1.105


aov(Speed~Run+E aleatorio, con "ejecuciones" y Expt 4 94514 23629 4.378
xpt,data=mm) "experimentos" como factores. Residuals 76 410166 5397
Pr(>F)
>summary(fm) Run 0.36321
Expt 0.00307 **
Residuals
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05
‘.’ 0.1 ‘ ’ 1
>fm0<- Ajusta el sub-modelo omitiendo Analysis of Variance Table
update(fm,.~.-Run) ‘runs’, y compara usando un
análisis formal de varianza. Model 1: Speed ~ Expt
>anova(fm0,fm) Model 2: Speed ~ Run + Expt
Res.Df RSS Df Sum of Sq F
1 95 523510
2 76 410166 19 113344 1.1053
Pr(>F)
1
2 0.3632
>detach() Limpia lo anteriormente
trabajador para seguir adelante.
>rm(fm,fm0)

>x<-seq(- “x” es un vector de 50 valores x


pi,pi,len=50) igualmente separados en el rango
−π≤x≤π; “y” es igual a “x” [1] -3.14159265 -3.01336438
>y<-x [3] -2.88513611 -2.75690784
[5] -2.62867957 -2.50045130
[7] -2.37222302 -2.24399475
[9] -2.11576648 -1.98753821
[11] -1.85930994 -1.73108167
[13] -1.60285339 -1.47462512
[15] -1.34639685 -1.21816858
[17] -1.08994031 -0.96171204
[19] -0.83348377 -0.70525549
[21] -0.57702722 -0.44879895
[23] -0.32057068 -0.19234241
[25] -0.06411414 0.06411414
[27] 0.19234241 0.32057068
[29] 0.44879895 0.57702722
[31] 0.70525549 0.83348377
[33] 0.96171204 1.08994031
[35] 1.21816858 1.34639685
[37] 1.47462512 1.60285339
[39] 1.73108167 1.85930994
[41] 1.98753821 2.11576648
[43] 2.24399475 2.37222302
[45] 2.50045130 2.62867957
[47] 2.75690784 2.88513611
[49] 3.01336438 3.14159265

[1] -3.14159265 -3.01336438


[3] -2.88513611 -2.75690784
[5] -2.62867957 -2.50045130
[7] -2.37222302 -2.24399475
[9] -2.11576648 -1.98753821
[11] -1.85930994 -1.73108167
[13] -1.60285339 -1.47462512
[15] -1.34639685 -1.21816858
[17] -1.08994031 -0.96171204
[19] -0.83348377 -0.70525549
[21] -0.57702722 -0.44879895
[23] -0.32057068 -0.19234241
[25] -0.06411414 0.06411414
[27] 0.19234241 0.32057068
[29] 0.44879895 0.57702722
[31] 0.70525549 0.83348377
[33] 0.96171204 1.08994031
[35] 1.21816858 1.34639685
[37] 1.47462512 1.60285339
[39] 1.73108167 1.85930994
[41] 1.98753821 2.11576648
[43] 2.24399475 2.37222302
[45] 2.50045130 2.62867957
[47] 2.75690784 2.88513611
[49] 3.01336438 3.14159265
>f<- “f” es una matriz cuadrada, con [,1] [,2]
outer(x,y,function( filas y columnas indexadas por [1,] -0.09199967 -0.09124435
x,y)cos(y)/(1+x^2)) “x” y “y” respectivamente, con [2,] -0.09920276 -0.09838830
valores de la función: [cos (y) / [3,] -0.10724999 -0.10636947
>f (1 + x2)]. [4,] -0.11627176 -0.11531717
[5,] -0.12642295 -0.12538502
[6,] -0.13788811 -0.13675606
[7,] -0.15088778 -0.14964899
[8,] -0.16568601 -0.16432573
[9,] -0.18259945 -0.18110031
[10,] -0.20200763 -0.20034915
[11,] -0.22436448 -0.22252245
[12,] -0.25020994 -0.24815572
[13,] -0.28017962 -0.27787935
[14,] -0.31500833 -0.31242211
[15,] -0.35551960 -0.35260078
[16,] -0.40258707 -0.39928184
[17,] -0.45704468 -0.45329235
[18,] -0.51951019 -0.51524502
[19,] -0.59007662 -0.58523209
[20,] -0.66783078 -0.66234790
[,3] [,4]
[1,] -0.08899081 -0.08527603
[2,] -0.09595832 -0.09195270
[3,] -0.10374236 -0.09941181
[4,] -0.11246907 -0.10777424
[5,] -0.12228827 -0.11718355
[6,] -0.13337846 -0.12781080
[7,] -0.14595297 -0.13986041
[8,] -0.16026723 -0.15357714
[9,] -0.17662751 -0.16925449
[10,] -0.19540094 -0.18724425
[11,] -0.21702661 -0.20796720
[12,] -0.24202679 -0.23192379
[13,] -0.27101630 -0.25970318
[14,] -0.30470594 -0.29198650
[15,] -0.34389228 -0.32953707
[16,] -0.38942041 -0.37316471
[17,] -0.44209697 -0.42364238
[18,] -0.50251954 -0.48154270
[19,] -0.57077808 -0.54695190
[20,] -0.64598928 -0.61902354
[,5] [,6]
[1,] -0.08016103 -0.07372979
[2,] -0.08643722 -0.07950244
[3,] -0.09344892 -0.08595160
[4,] -0.10130976 -0.09318177
[5,] -0.11015468 -0.10131707
[6,] -0.12014449 -0.11050541
[7,] -0.13147134 -0.12092352
[8,] -0.14436532 -0.13278303
[9,] -0.15910231 -0.14633769
[10,] -0.17601302 -0.16189166
[11,] -0.19549297 -0.17980875
[12,] -0.21801260 -0.20052166
[13,] -0.24412574 -0.22453976
[14,] -0.27447265 -0.25245196
[15,] -0.30977087 -0.28491825
[16,] -0.35078165 -0.32263877
[17,] -0.39823158 -0.36628184
[18,] -0.45265895 -0.41634255
[19,] -0.51414479 -0.47289544
[20,] -0.58189345 -0.53520868
[,7] [,8]
[1,] -0.06608790 -0.05736085
[2,] -0.07126224 -0.06185191
[3,] -0.07704296 -0.06686927
[4,] -0.08352374 -0.07249426
[5,] -0.09081584 -0.07882342
[6,] -0.09905184 -0.08597183
[7,] -0.10839014 -0.09407699
[8,] -0.11902044 -0.10330354
[9,] -0.13117020 -0.11384889
[10,] -0.14511205 -0.12594970
[11,] -0.16117208 -0.13988897
[12,] -0.17973815 -0.15600335
[13,] -0.20126685 -0.17468913
[14,] -0.22628603 -0.19640448
[15,] -0.25538727 -0.22166284
[16,] -0.28919816 -0.25100894
[17,] -0.32831775 -0.28496270
[18,] -0.37318981 -0.32390931
[19,] -0.42388115 -0.36790675
[20,] -0.47973581 -0.41638568
[,9] [,10]
[1,] -0.04769194 -0.03723993
[2,] -0.05142597 -0.04015562
[3,] -0.05559760 -0.04341301
[4,] -0.06027442 -0.04706487
[5,] -0.06553672 -0.05117390
[6,] -0.07148017 -0.05581481
[7,] -0.07821910 -0.06107686
[8,] -0.08589040 -0.06706694
[9,] -0.09465820 -0.07391322
[10,] -0.10471925 -0.08176932
[11,] -0.11630888 -0.09081901
[12,] -0.12970697 -0.10128082
[13,] -0.14524303 -0.11341204
[14,] -0.16329798 -0.12751012
[15,] -0.18429872 -0.14390841
[16,] -0.20869815 -0.16296054
[17,] -0.23692857 -0.18500408
[18,] -0.26931022 -0.21028907
[19,] -0.30589133 -0.23885319
[20,] -0.34619851 -0.27032678
[,11] [,12]
[1,] -0.02617644 -0.01468314
[2,] -0.02822592 -0.01583275
[3,] -0.03051558 -0.01711709
[4,] -0.03308252 -0.01855696
[5,] -0.03597082 -0.02017709
[6,] -0.03923297 -0.02200693
[7,] -0.04293173 -0.02408167
[8,] -0.04714224 -0.02644347
[9,] -0.05195458 -0.02914285
[10,] -0.05747674 -0.03224040
[11,] -0.06383788 -0.03580855
[12,] -0.07119163 -0.03993348
[13,] -0.07971883 -0.04471664
[14,] -0.08962856 -0.05027530
[15,] -0.10115513 -0.05674089
[16,] -0.11454713 -0.06425285
[17,] -0.13004182 -0.07294428
[18,] -0.14781498 -0.08291377
[19,] -0.16789308 -0.09417617
[20,] -0.19001628 -0.10658572
[,13] [,14]
[1,] -0.002948735 0.008834087
[2,] -0.003179605 0.009525749
[3,] -0.003437531 0.010298468
[4,] -0.003726693 0.011164766
[5,] -0.004052055 0.012139514
[6,] -0.004419532 0.013240434
[7,] -0.004836191 0.014488701
[8,] -0.005310498 0.015909672
[9,] -0.005852600 0.017533752
[10,] -0.006474663 0.019397384
[11,] -0.007191236 0.021544156
[12,] -0.008019623 0.024025916
[13,] -0.008980199 0.026903695
[14,] -0.010096514 0.030248053
[15,] -0.011394964 0.034138067
[16,] -0.012903551 0.038657629
[17,] -0.014649003 0.043886814
[18,] -0.016651121 0.049884941
[19,] -0.018912886 0.056660942
[20,] -0.021405030 0.064127132
[,15] [,16] [,17]
[1,] 0.02047185 0.03177347 0.04255337
[2,] 0.02207469 0.03426117 0.04588507
[3,] 0.02386537 0.03704040 0.04960723
[4,] 0.02587290 0.04015620 0.05378014
[5,] 0.02813175 0.04366207 0.05847545
[6,] 0.03068299 0.04762174 0.06377853
[7,] 0.03357569 0.05211137 0.06979137
[8,] 0.03686861 0.05722216 0.07663613
[9,] 0.04063220 0.06306347 0.08445924
[10,] 0.04495093 0.06976638 0.09343626
[11,] 0.04992579 0.07748765 0.10377716
[12,] 0.05567695 0.08641377 0.11573168
[13,] 0.06234583 0.09676425 0.12959380
[14,] 0.07009595 0.10879287 0.14570341
[15,] 0.07911055 0.12278404 0.16444143
[16,] 0.08958405 0.13903951 0.18621194
[17,] 0.10170201 0.15784726 0.21140067
[18,] 0.11560189 0.17942067 0.24029336
[19,] 0.13130440 0.20379184 0.27293303
[20,] 0.14860633 0.23064541 0.30889731
[,18] [,19] [,20]
[1,] 0.05263454 0.06185146 0.07005278
[2,] 0.05675555 0.06669410 0.07553754
[3,] 0.06135950 0.07210426 0.08166507
[4,] 0.06652101 0.07816961 0.08853466
[5,] 0.07232868 0.08499426 0.09626424
[6,] 0.07888809 0.09270230 0.10499435
[7,] 0.08632541 0.10144199 0.11489289
[8,] 0.09479173 0.11139085 0.12616095
[9,] 0.10446819 0.12276177 0.13903961
[10,] 0.11557193 0.13580991 0.15381789
[11,] 0.12836266 0.15084044 0.17084143
[12,] 0.14314928 0.16821637 0.19052135
[13,] 0.16029543 0.18836501 0.21334164
[14,] 0.18022151 0.21178038 0.23986182
[15,] 0.20339868 0.23901614 0.27070896
[16,] 0.23032677 0.27065965 0.30654830
[17,] 0.26148288 0.30727155 0.34801483
[18,] 0.29722044 0.34926717 0.39557894
[19,] 0.33759266 0.39670903 0.44931145
[20,] 0.38207712 0.44898323 0.50851705
[,21] [,22] [,23]
[1,] 0.07710383 0.08288884 0.08731281
[2,] 0.08314065 0.08937860 0.09414895
[3,] 0.08988494 0.09662890 0.10178622
[4,] 0.09744598 0.10475723 0.11034838
[5,] 0.10595357 0.11390314 0.11998243
[6,] 0.11556239 0.12423290 0.13086351
[7,] 0.12645725 0.13594519 0.14320091
[8,] 0.13885948 0.14927794 0.15724526
[9,] 0.15303443 0.16451642 0.17329706
[10,] 0.16930019 0.18200258 0.19171650
[11,] 0.18803720 0.20214541 0.21293440
[12,] 0.20969798 0.22543137 0.23746318
[13,] 0.23481520 0.25243311 0.26590608
[14,] 0.26400473 0.28381270 0.29896046
[15,] 0.29795674 0.32031209 0.33740791
[16,] 0.33740344 0.36271842 0.38207758
[17,] 0.38304371 0.41178303 0.43376088
[18,] 0.43539531 0.46806251 0.49304414
[19,] 0.49453619 0.53164066 0.56001560
[20,] 0.55970103 0.60169474 0.63380864
[,24] [,25] [,26]
[1,] 0.09030312 0.09181065 0.09181065
[2,] 0.09737338 0.09899894 0.09899894
[3,] 0.10527221 0.10702963 0.10702963
[4,] 0.11412761 0.11603286 0.11603286
[5,] 0.12409160 0.12616320 0.12616320
[6,] 0.13534534 0.13760481 0.13760481
[7,] 0.14810528 0.15057776 0.15057776
[8,] 0.16263062 0.16534559 0.16534559
[9,] 0.17923216 0.18222428 0.18222428
[10,] 0.19828244 0.20159258 0.20159258
[11,] 0.22022701 0.22390350 0.22390350
[12,] 0.24559586 0.24969586 0.24969586
[13,] 0.27501287 0.27960396 0.27960396
[14,] 0.30919931 0.31436111 0.31436111
[15,] 0.34896351 0.35478914 0.35478914
[16,] 0.39516303 0.40175992 0.40175992
[17,] 0.44861639 0.45610564 0.45610564
[18,] 0.50992999 0.51844281 0.51844281
[19,] 0.57919511 0.58886424 0.58886424
[20,] 0.65551542 0.66645865 0.66645865
[,27] [,28] [,29]
[1,] 0.09030312 0.08731281 0.08288884
[2,] 0.09737338 0.09414895 0.08937860
[3,] 0.10527221 0.10178622 0.09662890
[4,] 0.11412761 0.11034838 0.10475723
[5,] 0.12409160 0.11998243 0.11390314
[6,] 0.13534534 0.13086351 0.12423290
[7,] 0.14810528 0.14320091 0.13594519
[8,] 0.16263062 0.15724526 0.14927794
[9,] 0.17923216 0.17329706 0.16451642
[10,] 0.19828244 0.19171650 0.18200258
[11,] 0.22022701 0.21293440 0.20214541
[12,] 0.24559586 0.23746318 0.22543137
[13,] 0.27501287 0.26590608 0.25243311
[14,] 0.30919931 0.29896046 0.28381270
[15,] 0.34896351 0.33740791 0.32031209
[16,] 0.39516303 0.38207758 0.36271842
[17,] 0.44861639 0.43376088 0.41178303
[18,] 0.50992999 0.49304414 0.46806251
[19,] 0.57919511 0.56001560 0.53164066
[20,] 0.65551542 0.63380864 0.60169474
[,30] [,31] [,32]
[1,] 0.07710383 0.07005278 0.06185146
[2,] 0.08314065 0.07553754 0.06669410
[3,] 0.08988494 0.08166507 0.07210426
[4,] 0.09744598 0.08853466 0.07816961
[5,] 0.10595357 0.09626424 0.08499426
[6,] 0.11556239 0.10499435 0.09270230
[7,] 0.12645725 0.11489289 0.10144199
[8,] 0.13885948 0.12616095 0.11139085
[9,] 0.15303443 0.13903961 0.12276177
[10,] 0.16930019 0.15381789 0.13580991
[11,] 0.18803720 0.17084143 0.15084044
[12,] 0.20969798 0.19052135 0.16821637
[13,] 0.23481520 0.21334164 0.18836501
[14,] 0.26400473 0.23986182 0.21178038
[15,] 0.29795674 0.27070896 0.23901614
[16,] 0.33740344 0.30654830 0.27065965
[17,] 0.38304371 0.34801483 0.30727155
[18,] 0.43539531 0.39557894 0.34926717
[19,] 0.49453619 0.44931145 0.39670903
[20,] 0.55970103 0.50851705 0.44898323
[,33] [,34] [,35]
[1,] 0.05263454 0.04255337 0.03177347
[2,] 0.05675555 0.04588507 0.03426117
[3,] 0.06135950 0.04960723 0.03704040
[4,] 0.06652101 0.05378014 0.04015620
[5,] 0.07232868 0.05847545 0.04366207
[6,] 0.07888809 0.06377853 0.04762174
[7,] 0.08632541 0.06979137 0.05211137
[8,] 0.09479173 0.07663613 0.05722216
[9,] 0.10446819 0.08445924 0.06306347
[10,] 0.11557193 0.09343626 0.06976638
[11,] 0.12836266 0.10377716 0.07748765
[12,] 0.14314928 0.11573168 0.08641377
[13,] 0.16029543 0.12959380 0.09676425
[14,] 0.18022151 0.14570341 0.10879287
[15,] 0.20339868 0.16444143 0.12278404
[16,] 0.23032677 0.18621194 0.13903951
[17,] 0.26148288 0.21140067 0.15784726
[18,] 0.29722044 0.24029336 0.17942067
[19,] 0.33759266 0.27293303 0.20379184
[20,] 0.38207712 0.30889731 0.23064541
[,36] [,37]
[1,] 0.02047185 0.008834087
[2,] 0.02207469 0.009525749
[3,] 0.02386537 0.010298468
[4,] 0.02587290 0.011164766
[5,] 0.02813175 0.012139514
[6,] 0.03068299 0.013240434
[7,] 0.03357569 0.014488701
[8,] 0.03686861 0.015909672
[9,] 0.04063220 0.017533752
[10,] 0.04495093 0.019397384
[11,] 0.04992579 0.021544156
[12,] 0.05567695 0.024025916
[13,] 0.06234583 0.026903695
[14,] 0.07009595 0.030248053
[15,] 0.07911055 0.034138067
[16,] 0.08958405 0.038657629
[17,] 0.10170201 0.043886814
[18,] 0.11560189 0.049884941
[19,] 0.13130440 0.056660942
[20,] 0.14860633 0.064127132
[,38] [,39]
[1,] -0.002948735 -0.01468314
[2,] -0.003179605 -0.01583275
[3,] -0.003437531 -0.01711709
[4,] -0.003726693 -0.01855696
[5,] -0.004052055 -0.02017709
[6,] -0.004419532 -0.02200693
[7,] -0.004836191 -0.02408167
[8,] -0.005310498 -0.02644347
[9,] -0.005852600 -0.02914285
[10,] -0.006474663 -0.03224040
[11,] -0.007191236 -0.03580855
[12,] -0.008019623 -0.03993348
[13,] -0.008980199 -0.04471664
[14,] -0.010096514 -0.05027530
[15,] -0.011394964 -0.05674089
[16,] -0.012903551 -0.06425285
[17,] -0.014649003 -0.07294428
[18,] -0.016651121 -0.08291377
[19,] -0.018912886 -0.09417617
[20,] -0.021405030 -0.10658572
[,40] [,41]
[1,] -0.02617644 -0.03723993
[2,] -0.02822592 -0.04015562
[3,] -0.03051558 -0.04341301
[4,] -0.03308252 -0.04706487
[5,] -0.03597082 -0.05117390
[6,] -0.03923297 -0.05581481
[7,] -0.04293173 -0.06107686
[8,] -0.04714224 -0.06706694
[9,] -0.05195458 -0.07391322
[10,] -0.05747674 -0.08176932
[11,] -0.06383788 -0.09081901
[12,] -0.07119163 -0.10128082
[13,] -0.07971883 -0.11341204
[14,] -0.08962856 -0.12751012
[15,] -0.10115513 -0.14390841
[16,] -0.11454713 -0.16296054
[17,] -0.13004182 -0.18500408
[18,] -0.14781498 -0.21028907
[19,] -0.16789308 -0.23885319
[20,] -0.19001628 -0.27032678
[,42] [,43]
[1,] -0.04769194 -0.05736085
[2,] -0.05142597 -0.06185191
[3,] -0.05559760 -0.06686927
[4,] -0.06027442 -0.07249426
[5,] -0.06553672 -0.07882342
[6,] -0.07148017 -0.08597183
[7,] -0.07821910 -0.09407699
[8,] -0.08589040 -0.10330354
[9,] -0.09465820 -0.11384889
[10,] -0.10471925 -0.12594970
[11,] -0.11630888 -0.13988897
[12,] -0.12970697 -0.15600335
[13,] -0.14524303 -0.17468913
[14,] -0.16329798 -0.19640448
[15,] -0.18429872 -0.22166284
[16,] -0.20869815 -0.25100894
[17,] -0.23692857 -0.28496270
[18,] -0.26931022 -0.32390931
[19,] -0.30589133 -0.36790675
[20,] -0.34619851 -0.41638568
[,44] [,45]
[1,] -0.06608790 -0.07372979
[2,] -0.07126224 -0.07950244
[3,] -0.07704296 -0.08595160
[4,] -0.08352374 -0.09318177
[5,] -0.09081584 -0.10131707
[6,] -0.09905184 -0.11050541
[7,] -0.10839014 -0.12092352
[8,] -0.11902044 -0.13278303
[9,] -0.13117020 -0.14633769
[10,] -0.14511205 -0.16189166
[11,] -0.16117208 -0.17980875
[12,] -0.17973815 -0.20052166
[13,] -0.20126685 -0.22453976
[14,] -0.22628603 -0.25245196
[15,] -0.25538727 -0.28491825
[16,] -0.28919816 -0.32263877
[17,] -0.32831775 -0.36628184
[18,] -0.37318981 -0.41634255
[19,] -0.42388115 -0.47289544
[20,] -0.47973581 -0.53520868
[,46] [,47]
[1,] -0.08016103 -0.08527603
[2,] -0.08643722 -0.09195270
[3,] -0.09344892 -0.09941181
[4,] -0.10130976 -0.10777424
[5,] -0.11015468 -0.11718355
[6,] -0.12014449 -0.12781080
[7,] -0.13147134 -0.13986041
[8,] -0.14436532 -0.15357714
[9,] -0.15910231 -0.16925449
[10,] -0.17601302 -0.18724425
[11,] -0.19549297 -0.20796720
[12,] -0.21801260 -0.23192379
[13,] -0.24412574 -0.25970318
[14,] -0.27447265 -0.29198650
[15,] -0.30977087 -0.32953707
[16,] -0.35078165 -0.37316471
[17,] -0.39823158 -0.42364238
[18,] -0.45265895 -0.48154270
[19,] -0.51414479 -0.54695190
[20,] -0.58189345 -0.61902354
[,48] [,49]
[1,] -0.08899081 -0.09124435
[2,] -0.09595832 -0.09838830
[3,] -0.10374236 -0.10636947
[4,] -0.11246907 -0.11531717
[5,] -0.12228827 -0.12538502
[6,] -0.13337846 -0.13675606
[7,] -0.14595297 -0.14964899
[8,] -0.16026723 -0.16432573
[9,] -0.17662751 -0.18110031
[10,] -0.19540094 -0.20034915
[11,] -0.21702661 -0.22252245
[12,] -0.24202679 -0.24815572
[13,] -0.27101630 -0.27787935
[14,] -0.30470594 -0.31242211
[15,] -0.34389228 -0.35260078
[16,] -0.38942041 -0.39928184
[17,] -0.44209697 -0.45329235
[18,] -0.50251954 -0.51524502
[19,] -0.57077808 -0.58523209
[20,] -0.64598928 -0.66234790
[,50]
[1,] -0.09199967
[2,] -0.09920276
[3,] -0.10724999
[4,] -0.11627176
[5,] -0.12642295
[6,] -0.13788811
[7,] -0.15088778
[8,] -0.16568601
[9,] -0.18259945
[10,] -0.20200763
[11,] -0.22436448
[12,] -0.25020994
[13,] -0.28017962
[14,] -0.31500833
[15,] -0.35551960
[16,] -0.40258707
[17,] -0.45704468
[18,] -0.51951019
[19,] -0.59007662
[20,] -0.66783078
[ reached getOption("max.print") -- omitted 30
rows ]
>oldpar<- Se guardan los parametros de $xlog
par(no.readonly=T trazado y se establece la region [1] FALSE
RUE) de trazado en “square”. Oldpar se
dimensiona como variable. $ylog
>par(pty=”s”) [1] FALSE

>oldpar $adj
[1] 0.5

$ann
[1] TRUE

$ask
[1] FALSE

$bg
[1] "white"

$bty
[1] "o"
$cex
[1] 1

$cex.axis
[1] 1

$cex.lab
[1] 1

$cex.main
[1] 1.2

$cex.sub
[1] 1

$col
[1] "black"

$col.axis
[1] "black"

$col.lab
[1] "black"

$col.main
[1] "black"

$col.sub
[1] "black"

$crt
[1] 0

$err
[1] 0

$family
[1] ""

$fg
[1] "black"

$fig
[1] 0 1 0 1

$fin
[1] 4.125000 2.208333

$font
[1] 1

$font.axis
[1] 1

$font.lab
[1] 1

$font.main
[1] 2

$font.sub
[1] 1

$lab
[1] 5 5 7

$las
[1] 0

$lend
[1] "round"

$lheight
[1] 1

$ljoin
[1] "round"

$lmitre
[1] 10

$lty
[1] "solid"

$lwd
[1] 1

$mai
[1] 1.02 0.82 0.82 0.42

$mar
[1] 5.1 4.1 4.1 2.1

$mex
[1] 1

$mfcol
[1] 1 1

$mfg
[1] 1 1 1 1

$mfrow
[1] 1 1
$mgp
[1] 3 1 0

$mkh
[1] 0.001

$new
[1] FALSE

$oma
[1] 0 0 0 0

$omd
[1] 0 1 0 1

$omi
[1] 0 0 0 0

$pch
[1] 1

$pin
[1] 2.8850000 0.3683333

$plt
[1] 0.1987879 0.8981818 0.4618868
[4] 0.6286792

$ps
[1] 12

$pty
[1] "m"

$smo
[1] 1

$srt
[1] 0

$tck
[1] NA

$tcl
[1] -0.5

$usr
[1] 0.3 5.7 602.0 1088.0

$xaxp
[1] 1 5 4

$xaxs
[1] "r"

$xaxt
[1] "s"

$xpd
[1] FALSE

$yaxp
[1] 700 1000 3

$yaxs
[1] "r"

$yaxt
[1] "s"

$ylbias
[1] 0.2
>contour(x, y, f) Se crean mapas de contorno de
“f”’; el segundo mapa presentado
>contour(x,y,f, tiene mas “nlevels” y posee una
nlevels=15, tonalidad negra mas marcada.
add=TRUE)

>fa<-(f-t(f))/2 “fa” es la parte asimétrica de “f”; [,1] [,2]


“t ()” es la transposición. [1,] 0.000000000 3.979203e-03
[2,] -0.003979203 0.000000e+00
[3,] -0.009129591 -5.205574e-03
[4,] -0.015497862 -1.168223e-02
[5,] -0.023130959 -1.947390e-02
[6,] -0.032079164 -2.862681e-02
[7,] -0.042399937 -3.919338e-02
[8,] -0.054162579 -5.123691e-02
[9,] -0.067453752 -6.483717e-02
[10,] -0.082383847 -8.009676e-02
[11,] -0.099094019 -9.714827e-02
[12,] -0.117763403 -1.161615e-01
[13,] -0.138615441 -1.373499e-01
[14,] -0.161921207 -1.609739e-01
[15,] -0.187995724 -1.873377e-01
[16,] -0.217180273 -2.167715e-01
[17,] -0.249799027 -2.495887e-01
[18,] -0.286072369 -2.860003e-01
[19,] -0.325964037 -3.259631e-01
[20,] -0.368941778 -3.689427e-01
[,3] [,4]
[1,] 9.129591e-03 1.549786e-02
[2,] 5.205574e-03 1.168223e-02
[3,] 0.000000e+00 6.528631e-03
[4,] -6.528631e-03 0.000000e+00
[5,] -1.441967e-02 -7.936896e-03
[6,] -2.371343e-02 -1.731452e-02
[7,] -3.445501e-02 -2.816833e-02
[8,] -4.669898e-02 -4.054144e-02
[9,] -6.051496e-02 -5.449004e-02
[10,] -7.599397e-02 -7.008969e-02
[11,] -9.325552e-02 -8.744234e-02
[12,] -1.124549e-01 -1.066834e-01
[13,] -1.337894e-01 -1.279882e-01
[14,] -1.575022e-01 -1.515756e-01
[15,] -1.838788e-01 -1.777050e-01
[16,] -2.132304e-01 -2.066605e-01
[17,] -2.458521e-01 -2.387113e-01
[18,] -2.819395e-01 -2.740319e-01
[19,] -3.214412e-01 -3.125608e-01
[20,] -3.638272e-01 -3.537791e-01
[,5] [,6]
[1,] 2.313096e-02 0.03207916
[2,] 1.947390e-02 0.02862681
[3,] 1.441967e-02 0.02371343
[4,] 7.936896e-03 0.01731452
[5,] 0.000000e+00 0.00941371
[6,] -9.413710e-03 0.00000000
[7,] -2.032775e-02 -0.01093584
[8,] -3.277095e-02 -0.02340560
[9,] -4.678280e-02 -0.03742876
[10,] -6.241956e-02 -0.05303843
[11,] -7.976108e-02 -0.07028789
[12,] -9.891776e-02 -0.08925736
[13,] -1.200368e-01 -0.11006012
[14,] -1.433061e-01 -0.13284620
[15,] -1.689513e-01 -0.15780062
[16,] -1.972219e-01 -0.18513025
[17,] -2.283535e-01 -0.21503018
[18,] -2.624938e-01 -0.24761532
[19,] -2.995695e-01 -0.28279887
[20,] -3.390788e-01 -0.32010152
[,7] [,8]
[1,] 4.239994e-02 0.05416258
[2,] 3.919338e-02 0.05123691
[3,] 3.445501e-02 0.04669898
[4,] 2.816833e-02 0.04054144
[5,] 2.032775e-02 0.03277095
[6,] 1.093584e-02 0.02340560
[7,] 0.000000e+00 0.01247173
[8,] -1.247173e-02 0.00000000
[9,] -2.647555e-02 -0.01397925
[10,] -4.201759e-02 -0.02944138
[11,] -5.912017e-02 -0.04637336
[12,] -7.782824e-02 -0.06477994
[13,] -9.821533e-02 -0.08468932
[14,] -1.203874e-01 -0.10615708
[15,] -1.444815e-01 -0.12926572
[16,] -1.706548e-01 -0.15411555
[17,] -1.990546e-01 -0.18079941
[18,] -2.297576e-01 -0.20935052
[19,] -2.626616e-01 -0.23964880
[20,] -2.973143e-01 -0.27127331
[,9] [,10]
[1,] 6.745375e-02 8.238385e-02
[2,] 6.483717e-02 8.009676e-02
[3,] 6.051496e-02 7.599397e-02
[4,] 5.449004e-02 7.008969e-02
[5,] 4.678280e-02 6.241956e-02
[6,] 3.742876e-02 5.303843e-02
[7,] 2.647555e-02 4.201759e-02
[8,] 1.397925e-02 2.944138e-02
[9,] 0.000000e+00 1.540302e-02
[10,] -1.540302e-02 0.000000e+00
[11,] -3.217715e-02 -1.667113e-02
[12,] -5.028206e-02 -3.452021e-02
[13,] -6.969522e-02 -5.346869e-02
[14,] -9.041586e-02 -7.345375e-02
[15,] -1.124655e-01 -9.442967e-02
[16,] -1.358808e-01 -1.163635e-01
[17,] -1.606939e-01 -1.392202e-01
[18,] -1.868892e-01 -1.629305e-01
[19,] -2.143266e-01 -1.873315e-01
[20,] -2.426191e-01 -2.120723e-01
[,11] [,12]
[1,] 9.909402e-02 1.177634e-01
[2,] 9.714827e-02 1.161615e-01
[3,] 9.325552e-02 1.124549e-01
[4,] 8.744234e-02 1.066834e-01
[5,] 7.976108e-02 9.891776e-02
[6,] 7.028789e-02 8.925736e-02
[7,] 5.912017e-02 7.782824e-02
[8,] 4.637336e-02 6.477994e-02
[9,] 3.217715e-02 5.028206e-02
[10,] 1.667113e-02 3.452021e-02
[11,] 0.000000e+00 1.769154e-02
[12,] -1.769154e-02 0.000000e+00
[13,] -3.626380e-02 -1.834851e-02
[14,] -5.558636e-02 -3.715061e-02
[15,] -7.554046e-02 -5.620892e-02
[16,] -9.601739e-02 -7.533331e-02
[17,] -1.169095e-01 -9.433798e-02
[18,] -1.380888e-01 -1.130315e-01
[19,] -1.593668e-01 -1.311963e-01
[20,] -1.804289e-01 -1.485535e-01
[,13] [,14]
[1,] 1.386154e-01 1.619212e-01
[2,] 1.373499e-01 1.609739e-01
[3,] 1.337894e-01 1.575022e-01
[4,] 1.279882e-01 1.515756e-01
[5,] 1.200368e-01 1.433061e-01
[6,] 1.100601e-01 1.328462e-01
[7,] 9.821533e-02 1.203874e-01
[8,] 8.468932e-02 1.061571e-01
[9,] 6.969522e-02 9.041586e-02
[10,] 5.346869e-02 7.345375e-02
[11,] 3.626380e-02 5.558636e-02
[12,] 1.834851e-02 3.715061e-02
[13,] 0.000000e+00 1.850010e-02
[14,] -1.850010e-02 0.000000e+00
[15,] -3.687040e-02 -1.797894e-02
[16,] -5.483390e-02 -3.506762e-02
[17,] -7.212140e-02 -5.090830e-02
[18,] -8.847327e-02 -6.516829e-02
[19,] -1.036389e-01 -7.755972e-02
[20,] -1.173733e-01 -8.786734e-02
[,15] [,16]
[1,] 0.18799572 2.171803e-01
[2,] 0.18733774 2.167715e-01
[3,] 0.18387882 2.132304e-01
[4,] 0.17770499 2.066605e-01
[5,] 0.16895131 1.972219e-01
[6,] 0.15780062 1.851303e-01
[7,] 0.14448148 1.706548e-01
[8,] 0.12926572 1.541155e-01
[9,] 0.11246546 1.358808e-01
[10,] 0.09442967 1.163635e-01
[11,] 0.07554046 9.601739e-02
[12,] 0.05620892 7.533331e-02
[13,] 0.03687040 5.483390e-02
[14,] 0.01797894 3.506762e-02
[15,] 0.00000000 1.660000e-02
[16,] -0.01660000 0.000000e+00
[17,] -0.03136971 -1.418234e-02
[18,] -0.04389839 -2.545305e-02
[19,] -0.05385587 -3.343390e-02
[20,] -0.06105131 -3.795144e-02
[,17] [,18]
[1,] 0.249799027 2.860724e-01
[2,] 0.249588714 2.860003e-01
[3,] 0.245852100 2.819395e-01
[4,] 0.238711258 2.740319e-01
[5,] 0.228353518 2.624938e-01
[6,] 0.215030184 2.476153e-01
[7,] 0.199054563 2.297576e-01
[8,] 0.180799412 2.093505e-01
[9,] 0.160693902 1.868892e-01
[10,] 0.139220169 1.629305e-01
[11,] 0.116909492 1.380888e-01
[12,] 0.094337981 1.130315e-01
[13,] 0.072121402 8.847327e-02
[14,] 0.050908300 6.516829e-02
[15,] 0.031369708 4.389839e-02
[16,] 0.014182338 2.545305e-02
[17,] 0.000000000 1.059476e-02
[18,] -0.010594760 0.000000e+00
[19,] -0.017169259 -5.837252e-03
[20,] -0.019558760 -6.750911e-03
[,19] [,20]
[1,] 3.259640e-01 0.3689417777
[2,] 3.259631e-01 0.3689427187
[3,] 3.214412e-01 0.3638271762
[4,] 3.125608e-01 0.3537791004
[5,] 2.995695e-01 0.3390788467
[6,] 2.827989e-01 0.3201015157
[7,] 2.626616e-01 0.2973143472
[8,] 2.396488e-01 0.2712733131
[9,] 2.143266e-01 0.2426190625
[10,] 1.873315e-01 0.2120723335
[11,] 1.593668e-01 0.1804288540
[12,] 1.311963e-01 0.1485535360
[13,] 1.036389e-01 0.1173733336
[14,] 7.755972e-02 0.0878673427
[15,] 5.385587e-02 0.0610513150
[16,] 3.343390e-02 0.0379514436
[17,] 1.716926e-02 0.0195587601
[18,] 5.837252e-03 0.0067509114
[19,] 0.000000e+00 0.0001641131
[20,] -1.641131e-04 0.0000000000
[,21] [,22]
[1,] 4.136568e-01 0.457618440
[2,] 4.135956e-01 0.457446537
[3,] 4.077795e-01 0.450877443
[4,] 3.964140e-01 0.438137291
[5,] 3.798127e-01 0.419571780
[6,] 3.583954e-01 0.395643979
[7,] 3.326850e-01 0.366930932
[8,] 3.033038e-01 0.334119228
[9,] 2.709688e-01 0.297999729
[10,] 2.364863e-01 0.259461603
[11,] 2.007463e-01 0.219485697
[12,] 1.647157e-01 0.179137015
[13,] 1.294303e-01 0.139555590
[14,] 9.598366e-02 0.101944059
[15,] 6.550968e-02 0.067548612
[16,] 3.915359e-02 0.037627247
[17,] 1.802147e-02 0.013395095
[18,] 3.093887e-03 -0.004068835
[19,] -4.915271e-03 -0.013973835
[20,] -5.771603e-03 -0.016046656
[,23] [,24]
[1,] 4.970619e-01 5.273137e-01
[2,] 4.967575e-01 5.268903e-01
[3,] 4.894699e-01 5.190290e-01
[4,] 4.754434e-01 5.039880e-01
[5,] 4.550519e-01 4.821627e-01
[6,] 4.287971e-01 4.540840e-01
[7,] 3.973040e-01 4.204135e-01
[8,] 3.613164e-01 3.819385e-01
[9,] 3.216906e-01 3.395653e-01
[10,] 2.793893e-01 2.943124e-01
[11,] 2.354736e-01 2.473019e-01
[12,] 1.910951e-01 1.997510e-01
[13,] 1.474854e-01 1.529605e-01
[14,] 1.059429e-01 1.083010e-01
[15,] 6.781174e-02 6.719059e-02
[16,] 3.444836e-02 3.105957e-02
[17,] 7.163025e-03 1.289754e-03
[18,] -1.287879e-02 -2.088799e-02
[19,] -2.481714e-02 -3.456047e-02
[20,] -2.833949e-02 -3.938269e-02
[,25] [,26]
[1,] 0.543858425 0.543858425
[2,] 0.543364382 0.543364382
[3,] 0.535182294 0.535182294
[4,] 0.519577508 0.519577508
[5,] 0.496957452 0.496957452
[6,] 0.467868804 0.467868804
[7,] 0.432993169 0.432993169
[8,] 0.393141479 0.393141479
[9,] 0.349247327 0.349247327
[10,] 0.302359412 0.302359412
[11,] 0.253633145 0.253633145
[12,] 0.204321193 0.204321193
[13,] 0.155762162 0.155762162
[14,] 0.109365591 0.109365591
[15,] 0.066589581 0.066589581
[16,] 0.028904358 0.028904358
[17,] -0.002269559 -0.002269559
[18,] -0.025665864 -0.025665864
[19,] -0.040342194 -0.040342194
[20,] -0.045935053 -0.045935053
[,27] [,28]
[1,] 5.273137e-01 4.970619e-01
[2,] 5.268903e-01 4.967575e-01
[3,] 5.190290e-01 4.894699e-01
[4,] 5.039880e-01 4.754434e-01
[5,] 4.821627e-01 4.550519e-01
[6,] 4.540840e-01 4.287971e-01
[7,] 4.204135e-01 3.973040e-01
[8,] 3.819385e-01 3.613164e-01
[9,] 3.395653e-01 3.216906e-01
[10,] 2.943124e-01 2.793893e-01
[11,] 2.473019e-01 2.354736e-01
[12,] 1.997510e-01 1.910951e-01
[13,] 1.529605e-01 1.474854e-01
[14,] 1.083010e-01 1.059429e-01
[15,] 6.719059e-02 6.781174e-02
[16,] 3.105957e-02 3.444836e-02
[17,] 1.289754e-03 7.163025e-03
[18,] -2.088799e-02 -1.287879e-02
[19,] -3.456047e-02 -2.481714e-02
[20,] -3.938269e-02 -2.833949e-02
[,29] [,30]
[1,] 0.457618440 4.136568e-01
[2,] 0.457446537 4.135956e-01
[3,] 0.450877443 4.077795e-01
[4,] 0.438137291 3.964140e-01
[5,] 0.419571780 3.798127e-01
[6,] 0.395643979 3.583954e-01
[7,] 0.366930932 3.326850e-01
[8,] 0.334119228 3.033038e-01
[9,] 0.297999729 2.709688e-01
[10,] 0.259461603 2.364863e-01
[11,] 0.219485697 2.007463e-01
[12,] 0.179137015 1.647157e-01
[13,] 0.139555590 1.294303e-01
[14,] 0.101944059 9.598366e-02
[15,] 0.067548612 6.550968e-02
[16,] 0.037627247 3.915359e-02
[17,] 0.013395095 1.802147e-02
[18,] -0.004068835 3.093887e-03
[19,] -0.013973835 -4.915271e-03
[20,] -0.016046656 -5.771603e-03
[,31] [,32]
[1,] 0.3689417777 3.259640e-01
[2,] 0.3689427187 3.259631e-01
[3,] 0.3638271762 3.214412e-01
[4,] 0.3537791004 3.125608e-01
[5,] 0.3390788467 2.995695e-01
[6,] 0.3201015157 2.827989e-01
[7,] 0.2973143472 2.626616e-01
[8,] 0.2712733131 2.396488e-01
[9,] 0.2426190625 2.143266e-01
[10,] 0.2120723335 1.873315e-01
[11,] 0.1804288540 1.593668e-01
[12,] 0.1485535360 1.311963e-01
[13,] 0.1173733336 1.036389e-01
[14,] 0.0878673427 7.755972e-02
[15,] 0.0610513150 5.385587e-02
[16,] 0.0379514436 3.343390e-02
[17,] 0.0195587601 1.716926e-02
[18,] 0.0067509114 5.837252e-03
[19,] 0.0001641131 2.775558e-17
[20,] 0.0000000000 -1.641131e-04
[,33] [,34]
[1,] 2.860724e-01 0.249799027
[2,] 2.860003e-01 0.249588714
[3,] 2.819395e-01 0.245852100
[4,] 2.740319e-01 0.238711258
[5,] 2.624938e-01 0.228353518
[6,] 2.476153e-01 0.215030184
[7,] 2.297576e-01 0.199054563
[8,] 2.093505e-01 0.180799412
[9,] 1.868892e-01 0.160693902
[10,] 1.629305e-01 0.139220169
[11,] 1.380888e-01 0.116909492
[12,] 1.130315e-01 0.094337981
[13,] 8.847327e-02 0.072121402
[14,] 6.516829e-02 0.050908300
[15,] 4.389839e-02 0.031369708
[16,] 2.545305e-02 0.014182338
[17,] 1.059476e-02 0.000000000
[18,] 2.775558e-17 -0.010594760
[19,] -5.837252e-03 -0.017169259
[20,] -6.750911e-03 -0.019558760
[,35] [,36]
[1,] 2.171803e-01 0.18799572
[2,] 2.167715e-01 0.18733774
[3,] 2.132304e-01 0.18387882
[4,] 2.066605e-01 0.17770499
[5,] 1.972219e-01 0.16895131
[6,] 1.851303e-01 0.15780062
[7,] 1.706548e-01 0.14448148
[8,] 1.541155e-01 0.12926572
[9,] 1.358808e-01 0.11246546
[10,] 1.163635e-01 0.09442967
[11,] 9.601739e-02 0.07554046
[12,] 7.533331e-02 0.05620892
[13,] 5.483390e-02 0.03687040
[14,] 3.506762e-02 0.01797894
[15,] 1.660000e-02 0.00000000
[16,] 5.551115e-17 -0.01660000
[17,] -1.418234e-02 -0.03136971
[18,] -2.545305e-02 -0.04389839
[19,] -3.343390e-02 -0.05385587
[20,] -3.795144e-02 -0.06105131
[,37] [,38]
[1,] 1.619212e-01 1.386154e-01
[2,] 1.609739e-01 1.373499e-01
[3,] 1.575022e-01 1.337894e-01
[4,] 1.515756e-01 1.279882e-01
[5,] 1.433061e-01 1.200368e-01
[6,] 1.328462e-01 1.100601e-01
[7,] 1.203874e-01 9.821533e-02
[8,] 1.061571e-01 8.468932e-02
[9,] 9.041586e-02 6.969522e-02
[10,] 7.345375e-02 5.346869e-02
[11,] 5.558636e-02 3.626380e-02
[12,] 3.715061e-02 1.834851e-02
[13,] 1.850010e-02 3.209238e-17
[14,] 9.367507e-17 -1.850010e-02
[15,] -1.797894e-02 -3.687040e-02
[16,] -3.506762e-02 -5.483390e-02
[17,] -5.090830e-02 -7.212140e-02
[18,] -6.516829e-02 -8.847327e-02
[19,] -7.755972e-02 -1.036389e-01
[20,] -8.786734e-02 -1.173733e-01
[,39] [,40]
[1,] 1.177634e-01 9.909402e-02
[2,] 1.161615e-01 9.714827e-02
[3,] 1.124549e-01 9.325552e-02
[4,] 1.066834e-01 8.744234e-02
[5,] 9.891776e-02 7.976108e-02
[6,] 8.925736e-02 7.028789e-02
[7,] 7.782824e-02 5.912017e-02
[8,] 6.477994e-02 4.637336e-02
[9,] 5.028206e-02 3.217715e-02
[10,] 3.452021e-02 1.667113e-02
[11,] 1.769154e-02 5.551115e-17
[12,] 9.367507e-17 -1.769154e-02
[13,] -1.834851e-02 -3.626380e-02
[14,] -3.715061e-02 -5.558636e-02
[15,] -5.620892e-02 -7.554046e-02
[16,] -7.533331e-02 -9.601739e-02
[17,] -9.433798e-02 -1.169095e-01
[18,] -1.130315e-01 -1.380888e-01
[19,] -1.311963e-01 -1.593668e-01
[20,] -1.485535e-01 -1.804289e-01
[,41] [,42]
[1,] 8.238385e-02 6.745375e-02
[2,] 8.009676e-02 6.483717e-02
[3,] 7.599397e-02 6.051496e-02
[4,] 7.008969e-02 5.449004e-02
[5,] 6.241956e-02 4.678280e-02
[6,] 5.303843e-02 3.742876e-02
[7,] 4.201759e-02 2.647555e-02
[8,] 2.944138e-02 1.397925e-02
[9,] 1.540302e-02 4.857226e-17
[10,] 1.110223e-16 -1.540302e-02
[11,] -1.667113e-02 -3.217715e-02
[12,] -3.452021e-02 -5.028206e-02
[13,] -5.346869e-02 -6.969522e-02
[14,] -7.345375e-02 -9.041586e-02
[15,] -9.442967e-02 -1.124655e-01
[16,] -1.163635e-01 -1.358808e-01
[17,] -1.392202e-01 -1.606939e-01
[18,] -1.629305e-01 -1.868892e-01
[19,] -1.873315e-01 -2.143266e-01
[20,] -2.120723e-01 -2.426191e-01
[,43] [,44]
[1,] 0.05416258 4.239994e-02
[2,] 0.05123691 3.919338e-02
[3,] 0.04669898 3.445501e-02
[4,] 0.04054144 2.816833e-02
[5,] 0.03277095 2.032775e-02
[6,] 0.02340560 1.093584e-02
[7,] 0.01247173 3.469447e-17
[8,] 0.00000000 -1.247173e-02
[9,] -0.01397925 -2.647555e-02
[10,] -0.02944138 -4.201759e-02
[11,] -0.04637336 -5.912017e-02
[12,] -0.06477994 -7.782824e-02
[13,] -0.08468932 -9.821533e-02
[14,] -0.10615708 -1.203874e-01
[15,] -0.12926572 -1.444815e-01
[16,] -0.15411555 -1.706548e-01
[17,] -0.18079941 -1.990546e-01
[18,] -0.20935052 -2.297576e-01
[19,] -0.23964880 -2.626616e-01
[20,] -0.27127331 -2.973143e-01
[,45] [,46]
[1,] 0.03207916 2.313096e-02
[2,] 0.02862681 1.947390e-02
[3,] 0.02371343 1.441967e-02
[4,] 0.01731452 7.936896e-03
[5,] 0.00941371 5.551115e-17
[6,] 0.00000000 -9.413710e-03
[7,] -0.01093584 -2.032775e-02
[8,] -0.02340560 -3.277095e-02
[9,] -0.03742876 -4.678280e-02
[10,] -0.05303843 -6.241956e-02
[11,] -0.07028789 -7.976108e-02
[12,] -0.08925736 -9.891776e-02
[13,] -0.11006012 -1.200368e-01
[14,] -0.13284620 -1.433061e-01
[15,] -0.15780062 -1.689513e-01
[16,] -0.18513025 -1.972219e-01
[17,] -0.21503018 -2.283535e-01
[18,] -0.24761532 -2.624938e-01
[19,] -0.28279887 -2.995695e-01
[20,] -0.32010152 -3.390788e-01
[,47] [,48]
[1,] 1.549786e-02 9.129591e-03
[2,] 1.168223e-02 5.205574e-03
[3,] 6.528631e-03 3.469447e-17
[4,] 1.387779e-17 -6.528631e-03
[5,] -7.936896e-03 -1.441967e-02
[6,] -1.731452e-02 -2.371343e-02
[7,] -2.816833e-02 -3.445501e-02
[8,] -4.054144e-02 -4.669898e-02
[9,] -5.449004e-02 -6.051496e-02
[10,] -7.008969e-02 -7.599397e-02
[11,] -8.744234e-02 -9.325552e-02
[12,] -1.066834e-01 -1.124549e-01
[13,] -1.279882e-01 -1.337894e-01
[14,] -1.515756e-01 -1.575022e-01
[15,] -1.777050e-01 -1.838788e-01
[16,] -2.066605e-01 -2.132304e-01
[17,] -2.387113e-01 -2.458521e-01
[18,] -2.740319e-01 -2.819395e-01
[19,] -3.125608e-01 -3.214412e-01
[20,] -3.537791e-01 -3.638272e-01
[,49] [,50]
[1,] 3.979203e-03 0.000000000
[2,] 6.938894e-18 -0.003979203
[3,] -5.205574e-03 -0.009129591
[4,] -1.168223e-02 -0.015497862
[5,] -1.947390e-02 -0.023130959
[6,] -2.862681e-02 -0.032079164
[7,] -3.919338e-02 -0.042399937
[8,] -5.123691e-02 -0.054162579
[9,] -6.483717e-02 -0.067453752
[10,] -8.009676e-02 -0.082383847
[11,] -9.714827e-02 -0.099094019
[12,] -1.161615e-01 -0.117763403
[13,] -1.373499e-01 -0.138615441
[14,] -1.609739e-01 -0.161921207
[15,] -1.873377e-01 -0.187995724
[16,] -2.167715e-01 -0.217180273
[17,] -2.495887e-01 -0.249799027
[18,] -2.860003e-01 -0.286072369
[19,] -3.259631e-01 -0.325964037
[20,] -3.689427e-01 -0.368941778
>contour(x,y,fa,nle Permite ejecutar un dibujo de
ves=15) contorno.

>par(oldpar) Permite reestablecer los


parametros del grafico antiguo
“oldpar”
>image(x,y,f) Se realiza un grafico de imagenes
de alta densidad

>image(x,y,fa) Se realiza un grafico de imagenes


de alta densidad

>objects();rm(x,y,f, Elimina las variables [1] "f" "fa" "filepath"


fa) contempladas dentro del [4] "mm" "oldpar" "w"
parentesis [7] "x" "y"
>th<-seq(- Se obtiene un circulo pues
pi,pi,len=100) graficar argumentos complejos
significa trazar imágenes
imaginarias contra partes reales.
>z<-exp(1i*th)

>par(pty=”s”)

>plot(z,type=”1”)

>w<- Se toman numeros complejos con [1] -0.6850022+0.8606679i


rnorm(100)+rnorm partes reales normales e [2] 0.0234847-1.0452966i
(100)*1i imaginarios normales para [3] 0.5439129-0.3790404i
muestrear puntos dentro del [4] -0.5478619+0.6654903i
>w circulo unitario. [5] -0.0502320+0.3280169i
[6] -0.2401498-0.0814982i
[7] -0.5289380+0.4399018i
[8] -1.0581864-0.7840780i
[9] 0.8591834+1.0935070i
[10] 0.9348578+0.1245881i
[11] -1.0951155+0.7505712i
[12] -1.5227605+1.9507874i
[13] -1.4935594-0.3979949i
[14] 1.1749400-2.0488535i
[15] -0.6149874+0.1737550i
[16] 0.6385107-0.9230906i
[17] 1.6377582-0.3019796i
[18] -0.7354680-1.3473471i
[19] 0.7748157-0.0987345i
[20] -0.0667508-1.1301771i
[21] -0.3782429-0.7195394i
[22] -1.4305252-0.3369771i
[23] -1.2054370-2.5612528i
[24] 0.3916512+0.0185101i
[25] -0.4952900-0.0425537i
[26] -0.5156007-0.8575702i
[27] 2.0731910+0.0346354i
[28] 0.4195565+1.3205181i
[29] -0.3586490-1.2896236i
[30] 1.1015376+0.3576596i
[31] 0.6502524-0.2833343i
[32] 1.2029435-0.1738798i
[33] -2.2491748-0.1198092i
[34] 1.0979222+0.1974656i
[35] 1.9926196-1.2727039i
[36] 1.1450828-0.7250030i
[37] -1.1992111-1.2845979i
[38] 1.0330273+0.3200446i
[39] -1.8430416+0.2059683i
[40] -1.0306442+0.8672100i
[41] 0.4707940-0.6882891i
[42] 1.4692241+0.1292044i
[43] -0.7729329-1.1636724i
[44] 0.9700937+0.5686562i
[45] -1.1138898-1.7871155i
[46] 0.2613521-1.0914030i
[47] 1.5728498+1.0216160i
[48] -0.1732447-0.3291927i
[49] 0.5906301+0.3306322i
[50] -1.6650734-0.6797616i
[51] -0.3420523+0.2034709i
[52] 0.1925737+0.6522687i
[53] 0.9893607+1.1000014i
[54] 0.1821920+0.6353044i
[55] 0.9702233-1.6208903i
[56] 0.1322732-0.5256928i
[57] -0.1055102-0.9685613i
[58] -0.0432282+2.2718704i
[59] 0.7171363-1.0250221i
[60] 0.7197954+1.0692496i
[61] -0.9827023+1.8445377i
[62] -1.5181647-0.8212714i
[63] -2.6383588-0.1167118i
[64] -1.1586713+0.8362237i
[65] -0.0704119+1.3596790i
[66] -0.6603868+1.1732467i
[67] 0.6007092-0.6741922i
[68] -2.5712049+1.0517325i
[69] 0.4869621-0.7944842i
[70] -0.5632211-1.3959581i
[71] 2.3130151+0.2143853i
[72] -0.4292813+0.5347573i
[73] -0.2678336+0.3858808i
[74] -0.0004007+0.6406478i
[75] -0.5035325+1.6858799i
[76] 2.4249060+0.9459038i
[77] -0.6978509-0.6010103i
[78] 0.7282726+0.7821247i
[79] -0.9593343+0.2406636i
[80] 0.7905995+0.2440560i
[81] 0.8806779-0.1170344i
[82] 0.8426367-1.0568424i
[83] -0.0755001-2.3139611i
[84] 0.5246579-1.6427030i
[85] -0.7115530+0.0793763i
[86] -1.2690032-0.6229160i
[87] -1.9467775+2.2551607i
[88] 0.3980363+0.6796060i
[89] -0.3181332+0.0241432i
[90] -0.5524249+0.3951669i
[91] -0.0127835+0.2864155i
[92] -0.1326704+1.3200679i
[93] 0.3096508-1.5410368i
[94] -0.4880629+1.4657615i
[95] 0.5334778+0.5918116i
[96] 0.9357695-1.9557127i
[97] -0.0444881-0.1992742i
[98] -1.4560863+0.4076979i
[99] 2.3306913-0.0714430i
[100] -2.7801169+1.5447493i
>w<- Se usa para asignar cualquier [1] -0.5661282-0.7113092i
ifelse(Mod(w)>1,1/ variable fuera del circulo sobre [2] 0.0214826+0.9561836i
w,w) su reciproco [3] 0.5439129-0.3790404i
[4] -0.5478619+0.6654903i
>w [5] -0.0502320+0.3280169i
[6] -0.2401498-0.0814982i
[7] -0.5289380+0.4399018i
[8] -0.6100686+0.4520388i
[9] 0.4442626-0.5654256i
[10] 0.9348578+0.1245881i
[11] -0.6212945-0.4258234i
[12] -0.2486395-0.3185286i
[13] -0.6251505+0.1665864i
[14] 0.2106275+0.3672910i
[15] -0.6149874+0.1737550i
[16] 0.5068381+0.7327324i
[17] 0.5905143+0.1088825i
[18] -0.3121340+0.5718166i
[19] 0.7748157-0.0987345i
[20] -0.0520776+0.8817413i
[21] -0.3782429-0.7195394i
[22] -0.6622937+0.1560111i
[23] -0.1504334+0.3196334i
[24] 0.3916512+0.0185101i
[25] -0.4952900-0.0425537i
[26] -0.5149463+0.8564818i
[27] 0.4822136-0.0080560i
[28] 0.2185423-0.6878430i
[29] -0.2001660+0.7197532i
[30] 0.8212429-0.2666504i
[31] 0.6502524-0.2833343i
[32] 0.8142812+0.1177005i
[33] -0.4433495+0.0236164i
[34] 0.8822721-0.1586801i
[35] 0.3564418+0.2276626i
[36] 0.6233969+0.3947004i
[37] -0.3883079+0.4159564i
[38] 0.8832509-0.2736421i
[39] -0.5358886-0.0598880i
[40] -0.5680732-0.4779911i
[41] 0.4707940-0.6882891i
[42] 0.6754081-0.0593958i
[43] -0.3960592+0.5962784i
[44] 0.7672051-0.4497255i
[45] -0.2511854+0.4029998i
[46] 0.2075103+0.8665605i
[47] 0.4471428-0.2904335i
[48] -0.1732447-0.3291927i
[49] 0.5906301+0.3306322i
[50] -0.5147782+0.2101568i
[51] -0.3420523+0.2034709i
[52] 0.1925737+0.6522687i
[53] 0.4520028-0.5025505i
[54] 0.1821920+0.6353044i
[55] 0.2718764+0.4542066i
[56] 0.1322732-0.5256928i
[57] -0.1055102-0.9685613i
[58] -0.0083723-0.4400066i
[59] 0.4582473+0.6549851i
[60] 0.4332463-0.6435834i
[61] -0.2249764-0.4222820i
[62] -0.5095691+0.2756582i
[63] -0.3782833+0.0167339i
[64] -0.5674784-0.4095544i
[65] -0.0379848-0.7335006i
[66] -0.3643275-0.6472662i
[67] 0.6007092-0.6741922i
[68] -0.3331769-0.1362836i
[69] 0.4869621-0.7944842i
[70] -0.2485621+0.6160676i
[71] 0.4286537-0.0397304i
[72] -0.4292813+0.5347573i
[73] -0.2678336+0.3858808i
[74] -0.0004007+0.6406478i
[75] -0.1626536-0.5445813i
[76] 0.3579248-0.1396188i
[77] -0.6978509-0.6010103i
[78] 0.6376610-0.6848127i
[79] -0.9593343+0.2406636i
[80] 0.7905995+0.2440560i
[81] 0.8806779-0.1170344i
[82] 0.4612253+0.5784729i
[83] -0.0140855+0.4316998i
[84] 0.1764304+0.5524032i
[85] -0.7115530+0.0793763i
[86] -0.6350117+0.3117084i
[87] -0.2193381-0.2540828i
[88] 0.3980363+0.6796060i
[89] -0.3181332+0.0241432i
[90] -0.5524249+0.3951669i
[91] -0.0127835+0.2864155i
[92] -0.0753732-0.7499616i
[93] 0.1253303+0.6237303i
[94] -0.2044960-0.6141470i
[95] 0.5334778+0.5918116i
[96] 0.1990797+0.4160669i
[97] -0.0444881-0.1992742i
[98] -0.6368454-0.1783139i
[99] 0.4286545+0.0131396i
[100] -0.2748427-0.1527141i
>plot(w,xlim=c(- Todos los puntos se encuentran
1,1),ylim=c(- dentro del círculo unitario;sin
1,1),pch=”+”,xlab= embargo, la distribución no es
”x”,ylab=”y”) uniforme.

>lines(z)

> w <- Al usarse la distribucion


sqrt(runif(100))*ex uniforme, los puntos ahora se
p(2*pi*runif(100)* logran ver mejor y mas
1i) espaciados uniformemente sobre
> plot(w, xlim=c(- el disco.
1,1), ylim=c(-1,1),
pch="+", xlab="x",
ylab="y")
>lines(z)
>rm(th,w,z) Se encarga de limpiar las
variables que están dentro del
paréntesis.
>q() Con este comando, indicamos a Save workspace image to ~/.RData? [y/n/c]:
R que debe cerrar la sesión. y

PARTE 1B

Expresión Descripción Resultado


>install.packages Dentro del menú principal, also installing the dependencies ‘colorspace’,
(“UsingR”) en la pestana “tools” es ‘assertthat’, ‘utf8’, ‘mime’, ‘labeling’,
donde se digita “UsingR” ‘munsell’, ‘R6’, ‘cli’, ‘crayon’, ‘fansi’,
donde esta el espacio para ‘pillar’, ‘pkgconfig’, ‘glue’, ‘stringi’,
paquetes de instalacion. ‘evaluate’, ‘highr’, ‘markdown’, ‘yaml’,
‘xfun’, ‘backports’, ‘jsonlite’, ‘digest’,
‘lazyeval’, ‘plyr’, ‘reshape2’, ‘rlang’,
‘scales’, ‘tibble’, ‘viridisLite’, ‘withr’,
‘RColorBrewer’, ‘stringr’, ‘knitr’, ‘magrittr’,
‘checkmate’, ‘htmlwidgets’, ‘rstudioapi’,
‘Rcpp’, ‘Formula’, ‘ggplot2’, ‘latticeExtra’,
‘acepack’, ‘gtable’, ‘gridExtra’, ‘data.table’,
‘htmlTable’, ‘viridis’, ‘htmltools’,
‘base64enc’, ‘HistData’, ‘Hmisc’

There is a binary version


available but the source version
is later:
binary source needs_compilation
knitr 1.20 1.21 FALSE

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/colorspace_1.4-0.tgz'
Content type 'application/x-gzip' length
2340274 bytes (2.2 MB)
================================
==================
downloaded 2.2 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/assertthat_0.2.0.tgz'
Content type 'application/x-gzip' length
42504 bytes (41 KB)
================================
==================
downloaded 41 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/utf8_1.1.4.tgz'
Content type 'application/x-gzip' length
172781 bytes (168 KB)
================================
==================
downloaded 168 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/mime_0.6.tgz'
Content type 'application/x-gzip' length
26324 bytes (25 KB)
================================
==================
downloaded 25 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/labeling_0.3.tgz'
Content type 'application/x-gzip' length
39467 bytes (38 KB)
================================
==================
downloaded 38 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/munsell_0.5.0.tgz'
Content type 'application/x-gzip' length
217317 bytes (212 KB)
================================
==================
downloaded 212 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/R6_2.3.0.tgz'
Content type 'application/x-gzip' length
34492 bytes (33 KB)
================================
==================
downloaded 33 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/cli_1.0.1.tgz'
Content type 'application/x-gzip' length
544664 bytes (531 KB)
================================
==================
downloaded 531 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/crayon_1.3.4.tgz'
Content type 'application/x-gzip' length
709728 bytes (693 KB)
================================
==================
downloaded 693 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/fansi_0.4.0.tgz'
Content type 'application/x-gzip' length
172972 bytes (168 KB)
================================
==================
downloaded 168 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/pillar_1.3.1.tgz'
Content type 'application/x-gzip' length
86893 bytes (84 KB)
================================
==================
downloaded 84 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/pkgconfig_2.0.2.tgz'
Content type 'application/x-gzip' length
15456 bytes (15 KB)
================================
==================
downloaded 15 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/glue_1.3.0.tgz'
Content type 'application/x-gzip' length
93367 bytes (91 KB)
================================
==================
downloaded 91 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/stringi_1.2.4.tgz'
Content type 'application/x-gzip' length
13513176 bytes (12.9 MB)
================================
==================
downloaded 12.9 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/evaluate_0.12.tgz'
Content type 'application/x-gzip' length
46403 bytes (45 KB)
================================
==================
downloaded 45 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/highr_0.7.tgz'
Content type 'application/x-gzip' length
29388 bytes (28 KB)
================================
==================
downloaded 28 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/markdown_0.9.tgz'
Content type 'application/x-gzip' length
175235 bytes (171 KB)
================================
==================
downloaded 171 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/yaml_2.2.0.tgz'
Content type 'application/x-gzip' length
191863 bytes (187 KB)
================================
==================
downloaded 187 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/xfun_0.4.tgz'
Content type 'application/x-gzip' length
108251 bytes (105 KB)
================================
==================
downloaded 105 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/backports_1.1.3.tgz'
Content type 'application/x-gzip' length
53800 bytes (52 KB)
================================
==================
downloaded 52 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/jsonlite_1.6.tgz'
Content type 'application/x-gzip' length
1070380 bytes (1.0 MB)
================================
==================
downloaded 1.0 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/digest_0.6.18.tgz'
Content type 'application/x-gzip' length
166752 bytes (162 KB)
================================
==================
downloaded 162 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/lazyeval_0.2.1.tgz'
Content type 'application/x-gzip' length
123472 bytes (120 KB)
================================
==================
downloaded 120 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/plyr_1.8.4.tgz'
Content type 'application/x-gzip' length
818975 bytes (799 KB)
================================
==================
downloaded 799 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/reshape2_1.4.3.tgz'
Content type 'application/x-gzip' length
259673 bytes (253 KB)
================================
==================
downloaded 253 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/rlang_0.3.1.tgz'
Content type 'application/x-gzip' length
1135713 bytes (1.1 MB)
================================
==================
downloaded 1.1 MB
trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/scales_1.0.0.tgz'
Content type 'application/x-gzip' length
590050 bytes (576 KB)
================================
==================
downloaded 576 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/tibble_2.0.1.tgz'
Content type 'application/x-gzip' length
640837 bytes (625 KB)
================================
==================
downloaded 625 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/viridisLite_0.3.0.tgz'
Content type 'application/x-gzip' length
53512 bytes (52 KB)
================================
==================
downloaded 52 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/withr_2.1.2.tgz'
Content type 'application/x-gzip' length
122230 bytes (119 KB)
================================
==================
downloaded 119 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/RColorBrewer_1.1-2.tgz'
Content type 'application/x-gzip' length
24322 bytes (23 KB)
================================
==================
downloaded 23 KB
trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/stringr_1.3.1.tgz'
Content type 'application/x-gzip' length
167212 bytes (163 KB)
================================
==================
downloaded 163 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/magrittr_1.5.tgz'
Content type 'application/x-gzip' length
152460 bytes (148 KB)
================================
==================
downloaded 148 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/checkmate_1.9.1.tgz'
Content type 'application/x-gzip' length
715325 bytes (698 KB)
================================
==================
downloaded 698 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/htmlwidgets_1.3.tgz'
Content type 'application/x-gzip' length
762468 bytes (744 KB)
================================
==================
downloaded 744 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/rstudioapi_0.9.0.tgz'
Content type 'application/x-gzip' length
154521 bytes (150 KB)
================================
==================
downloaded 150 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/Rcpp_1.0.0.tgz'
Content type 'application/x-gzip' length
4343466 bytes (4.1 MB)
================================
==================
downloaded 4.1 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/Formula_1.2-3.tgz'
Content type 'application/x-gzip' length
161847 bytes (158 KB)
================================
==================
downloaded 158 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/ggplot2_3.1.0.tgz'
Content type 'application/x-gzip' length
3179264 bytes (3.0 MB)
================================
==================
downloaded 3.0 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/latticeExtra_0.6-28.tgz'
Content type 'application/x-gzip' length
2072202 bytes (2.0 MB)
================================
==================
downloaded 2.0 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/acepack_1.4.1.tgz'
Content type 'application/x-gzip' length
74840 bytes (73 KB)
================================
==================
downloaded 73 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/gtable_0.2.0.tgz'
Content type 'application/x-gzip' length
57162 bytes (55 KB)
================================
==================
downloaded 55 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/gridExtra_2.3.tgz'
Content type 'application/x-gzip' length
1077959 bytes (1.0 MB)
================================
==================
downloaded 1.0 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/data.table_1.12.0.tgz'
Content type 'application/x-gzip' length
1756887 bytes (1.7 MB)
================================
==================
downloaded 1.7 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/htmlTable_1.13.1.tgz'
Content type 'application/x-gzip' length
251166 bytes (245 KB)
================================
==================
downloaded 245 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/viridis_0.5.1.tgz'
Content type 'application/x-gzip' length
1864608 bytes (1.8 MB)
================================
==================
downloaded 1.8 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/htmltools_0.3.6.tgz'
Content type 'application/x-gzip' length
205363 bytes (200 KB)
================================
==================
downloaded 200 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/base64enc_0.1-3.tgz'
Content type 'application/x-gzip' length
27274 bytes (26 KB)
================================
==================
downloaded 26 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/HistData_0.8-4.tgz'
Content type 'application/x-gzip' length
356598 bytes (348 KB)
================================
==================
downloaded 348 KB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/Hmisc_4.1-1.tgz'
Content type 'application/x-gzip' length
1798684 bytes (1.7 MB)
================================
==================
downloaded 1.7 MB

trying URL
'https://cran.rstudio.com/bin/macosx/el-
capitan/contrib/3.4/UsingR_2.0-6.tgz'
Content type 'application/x-gzip' length
2031881 bytes (1.9 MB)
================================
==================
downloaded 1.9 MB

The downloaded binary packages are in


/var/folders/68/1hcnbzx57j9gj_143yx
7l_4r0000gn/T//RtmprZGFVs/downloaded_
packages
installing the source package ‘knitr’

trying URL
'https://cran.rstudio.com/src/contrib/knitr_1.2
1.tar.gz'
Content type 'application/x-gzip' length
699667 bytes (683 KB)
================================
==================
downloaded 683 KB

* installing *source* package ‘knitr’ ...


** package ‘knitr’ successfully unpacked
and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (knitr)

The downloaded source packages are in


‘/private/var/folders/68/1hcnbzx57j9
gj_143yx7l_4r0000gn/T/RtmprZGFVs/down
loaded_packages’
>library(UsingR) Se carga el paquete “Using Loading required package: MASS
R” Loading required package: HistData
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: ‘Hmisc’

The following objects are masked from


‘package:base’:

format.pval, units
Attaching package: ‘UsingR’

The following object is masked from


‘package:survival’:

cancer

Warning messages:
1: package ‘UsingR’ was built under R
version 3.4.4
2: package ‘HistData’ was built under R
version 3.4.4
3: package ‘Formula’ was built under R
version 3.4.4
4: package ‘ggplot2’ was built under R
version 3.4.4

TAREA 1B

>1+2*(3+4) Permite [1] 15


utilizar R
>4^3+3^(2+1) como [1] 91
calculadora.
>sqrt((4+3)*(2+1)) [1] 4.582576

>((1+2)/(3+4))^2 [1]
0.1836735

> 2+3-4 Se utiliza R [1] 1


como
>2+3*4 calculadora, [1] 14
>2/3/4 procurando [1]
usar paréntesis 0.1666667
>2^3^4 para indicar el
orden en el [1]
que R debe 2.417852e+
efectuar las 24
operaciones.
> p<-c(2,3,5,7,11,13,17,19) Se introducen [1] 2 3 5 7
>p los valores 11 13 17 19
>length(p) numericos
dentro de la
variable “p”. [1] 8
Se utiliza
length() para
medir la
longitud.
> gas<- En la variable [1] 65311
c(65311,65624,65908,66219,66499,66821,67145,67447) “gas” y 65624
mediante la 65908
función “diff” 66219
se interpreta el [5] 66499
> diff(gas) kilometraje del 66821
vehículo. 67145
La función 67447
diff() permite
> mean(gas) especificar el [1] 313 284
orden de las 311 280 322
diferencias. 324 302
>mean(diff(gas)) Mean()
permite
calcular la [1] 66371.75
media
aritmética.
Mean(diff(gas)
) da a conocer [1] 305.1429
la media
aritmética de
las diferencias.
> x<-c(2,5,4,10,8) Se introducen [1] 2 5 4
>x los datos en un 10 8
> sqrt(x) data vector
>x1= x-6 “x”. [1] 1.414214
>x1 2.236068
>x2=sqrt(x-9) Usando “sqrt” 2.000000
>x2 obtenemos la [4] 3.162278
raíz cuadrada 2.828427
de los valores.
[1] -4 -1 -2
Se le resta 6 a 4 2
los valores
[1] NaN
Se le resta 9 a NaN NaN
los valores y 1 NaN
luego se le
saca raíz
cuadrada.
> m<-c(15.9,21.4,19.9,21.9,20.0,16.5,17.9,17.5) Despues de [1] 15.9 21.4
>m enlistar los 19.9 21.9
valores de 20.0
> min(m) MINI Coopers [6] 16.5 17.9
> max(m) dentro de la 17.5
variable “m”,
> mean(m) usamos la [1] 15.9
función
> range(m)-mean(m) [min(m)] para [1] 21.9
conseguir el
valor mas [1] 18.875
pequeño,
[max(m)] para [1] -2.975
el minimo, 3.025
[mean(m)]
para el valor
promedio y
[range(m)-
mean(m)] para
la diferencia
entre valor
promedio y el
rango
> h2<- Las ventas [1] 2700
c(2700,2600,3050,2900,3000,2500,2600,3000,2800,3200,280 mensuales del 2600 3050
0,3400) Hummer H2 2900 3000
> h2 se registran [6] 2500
dentro de la 2600 3000
variable “h2”. 2800 3200
[11] 2800
La función 3400
> cumsum(h2) cumsum(h2)
permite [1] 2700
> diff(h2) conocer el 5300 8350
total 11250
>max(diff(h2)) acumulativo [5] 14250
de ventas para 16750
>min(diff(h2)) el año. 19350
22350
Diff(h2) [9] 25150
permite 28350
conocer en que 31150
proporción 34550
cambian las
ventas [1] -100
mensuales con 450 -150
respecto al 100 -500
mes anterior, [6] 100
max(diff(h2)) 400 -200
y 400 -400
min(diff(h2)) [11] 600
indican el mes
con el mayor [1] 600
incremento y
el mes con el [1] -500
menor
incremento,
respectivament
e.
> fcal<-c(37,36.2,34,32.1) Los [1] 37.0 36.2
> fcal porcentajes de 34.0 32.1
calorias de
> mean(fcal) grasa se [1] 34.825
almacenan en
la variable
“fcal”; con la
función
“mean(fcal)”
se obtiene el
numero
promedio de
calorías a
través de los
años, el cual
parece ir
reduciendo
respecto a los
primeros dos
años.
> rep(c("a"),each=5) Se crean [1] "a" "a"
secuencias de "a" "a" "a"
letras o
> seq(1,99,by=2) números con [1] 1 3 5 7
“seq” y 9 11 13 15
> rep(c(1,2,3),each=3) repeticiones 17
con “rep”. [10] 19 21
> rep(1:3,times=3:1) “Each” indica 23 25 27 29
cuantas veces 31 33 35
> c(1:5,4:1) se repetirá [19] 37 39
cada elemento, 41 43 45 47
“by” indica en 49 51 53
cuanto ira [28] 55 57
contando, 59 61 63 65
“times” dice 67 69 71
cuantas veces [37] 73 75
se repetirá el 77 79 81 83
conjunto. 85 87 89
[46] 91 93
95 97 99

[1] 1 1 1 2 2
2333

[1] 1 1 1 2 2
3

[1] 1 2 3 4 5
4321

>fibonacci<-c(1,2,3,5,8,13,21,34) Se guardan [1] 1 2 3 5


fibonacci “data sets” en 8 13 21 34
en variables
> a<-seq(1:10) utilizando [1] 1 2 3 4
a diferentes 5 6 7 8 9
métodos. Se [10] 10
>frac<-(1/seq(1:10)) vuelven a
frac utilizar las [1]
funciones 1.0000000
> rep(1964:2003,each=1) “seq” y “rep”, 0.5000000
asi como [3]
> seq(0,1000,by=25) “each”, “:” y 0.3333333
“by”. 0.2500000
[5]
0.2000000
0.1666667
[7]
0.1428571
0.1250000
[9]
0.1111111
0.1000000

[1] 1964
1965 1966
1967 1968
[6] 1969
1970 1971
1972 1973
[11] 1974
1975 1976
1977 1978
[16] 1979
1980 1981
1982 1983
[21] 1984
1985 1986
1987 1988
[26] 1989
1990 1991
1992 1993
[31] 1994
1995 1996
1997 1998
[36] 1999
2000 2001
2002 2003

[1] 0 25
50 75 100
[6] 125
150 175
200 225
[11] 250
275 300
325 350
[16] 375
400 425
450 475
[21] 500
525 550
575 600
[26] 625
650 675
700 725
[31] 750
775 800
825 850
[36] 875
900 925
950 975
[41] 1000

> d<-c(17,16,20,24,22,15,21,15,17,22) Se insertan los minutos


dentro de la variable “d”.
> max(d) La función “max(d)”
permite conocer el valor [1] 24
mas grande.
> mean(d) La función “mean(d)”
permite conocer el valor [1] 18.9
> min(d) promedio. [min(d)]
permite conocer el mínimo [1] 15
> d<-c(17,16,20,18,22,15,21,15,17,22) valor.
>d[4]=18 Con “d[>=20]”
conocemos cuales valores
> mean(d) son iguales o mayores a
20, y con “sum(d>=20)” [1] 18.3
> d[d>=20] sabemos cuantos valores
son mayores o iguales a [1] 20 22
> sum(d>=20) 20. Con 21 22
sum(d<18)/length(d)
sabemos que porcentaje es [1] 4
> sum(d<18)/length(d) menor a 18.

[1] 0.5
> dvd1<-c(79,161,133,99,143,249,302) Se almacenan los meses [1] 79 161
> dvd1 del año dentro del vector 133 99
> dvd2<-c(74,127,210,249,368) “dvd”, al inicio los que 143 249
> dvd2 tienen 31 dias y después 302
>mean(dvd1) los de 30.
>mean(dvd2) Se obtiene el valor [1] 74 127
promedio de los vectores 210 249
“mean(dvd1)” y 368
“mean(dvd2)”.
[1]
166.5714

[1] 205.6
> bill<-c(46,33,39,37,46,30,48,32,49,35,30,48) Se insertan las facturas [1] 46 33
> bill mensuales del teléfono en 39 37 46
el vector “bill”. La función 30 48 32
“sum(bill)” permite 49
> sum(bill) encontrar el valor total [10] 35 30
gastado durante el año. 48
> min(bill) Con “min(bill)” y con
“max(bill)” conocemos el [1] 473
> max(bill) menor y mayor valor,
respectivamente. [1] 30
> sum(bill>40) “sum(bill>40)/length(bill)
” nos dice cuantos valores [1] 49
> sum(bill>40)/length(bill) son mayores a 40 y
sum(bill>40)/length(bill) [1] 5
indica el porcentaje de
facturas que exceden 40. [1]
0.4166667

> sal<- El salario promedio de los [1] 0.57


c(0.57,0.89,1.08,1.12,1.18,1.07,1.17,1.38,1.44,1.72 diez años es insertado en 0.89 1.08
) la variable “sal”. 1.12 1.18
> sal Con la función diff(sal) [6] 1.07
obtenemos las diferencias 1.17 1.38
> diff(sal) de año con año. 1.44 1.72
Con “diff(sal)/(sal[-10])”
> diff(sal)/(sal[-10]) Obtenemos la diferencia [1] 0.32
porcentual dividiendo 0.19 0.04
> max(diff(sal)/(sal[-10])) diff(sal) entre los primeros 0.06
nueve números, usando “[- [5] -0.11
10]” excluimos el decimo 0.10 0.21
numero. 0.06
Con “max(diff(sal)/(sal[- [9] 0.28
10]))” se determina cual
a;o tuvo el mayor [1]
incremento porcentual. 0.5614035
1
0.2134831
5
[3]
0.0370370
4
0.0535714
3
[5] -
0.0932203
4
0.0934579
4
[7]
0.1794871
8
0.0434782
6
[9]
0.1944444
4

[1]
0.5614035
>x=c(1,3,5,7,9) Tras definir las variables “x” y [1] 2 4 6 8 10
>y=c(2,3,5,7,11,13) “y”, se ejecutan las siguientes
operaciones: [1] 4 6 10 14 22 26
> x+1
> y*2 Suma y multiplicación que [1] 5
> length(x) involucran las variables.
Length() permite conocer [1] 6
> length(y) cuantos elementos posee el
conjunto. [1] 3 6 10 14 20 14
> x+y Warning message:
NA significa que no esta In x + y : longer object
definido un valor indicador. length is not a multiple
> sum(x>5) of shorter object length
> sum(x[x>5])
> sum(x>5|x<3) [1] 2

[1] 16
[1] 3
[1] 5
[1] 2 3 7 11 13
[1] 2 5 11 NA NA
[1] 7 11 13

>y[3]

>y[-3]

>y[x]

> y[y>=7]

> "ABCDE"=="ABCDE" Los datos contenidos entre comillas son [1] TRUE
comparados entre si utilizando el signo “=” [1] TRUE
> "ABCDE"<"ABCDEF" para comprobar si es una igualdad o no; si [1] FALSE
> "ABCDE"<"abcde" efectivamente lo es, el resultado será [1] FALSE
> "ZZZZZ"<"aaaaa" “TRUE” sino arrojara “FALSE” [1] TRUE
> "11"<"8"

> Con esta función se despliega la Asia


sort(islands,decreasing=TRUE)[1:7] información sobre los cuerpos de tierra Africa
que exceden de 10,000 millas 16988
cuadradas, puntualmente especificando 11506
cuales son las siete de mayor longitud. North
America
South
America
9390
6795
Antarctica
Europe
5500
3745
Australia
2968

> primes Se carga el data set “primes” donde se [1] 2 3


almacenan todos los números primos 5 7 11
> length(primes) del 1 al 2003. [6] 13 17
“Length(primes)” permite conocer la 19 23 29
> length(primes[primes<=100]) cantidad de elementos dentro del data [11] 31 37
set. 41 43 47
[16] 53 59
> length(primes[primes>=100 & Con “length(primes[primes<=100])” 61 67 71
primes<=1000]) indicamos cuantos elementos hay en el [21] 73 79
rango de 1 al 100. 83 89 97
[26] 101
Con “length(primes[primes>=100 & 103 107 109
primes<=1000])” indicamos cuantos 113
elementos hay en el rango de 100 a [31] 127
1000. 131 137 139
149
[36] 151
157 163 167
173
[41] 179
181 191 193
197
[46] 199
211 223 227
229
[51] 233
239 241 251
257
[56] 263
269 271 277
281
[61] 283
293 307 311
313
[66] 317
331 337 347
349
[71] 353
359 367 373
379
[76] 383
389 397 401
409
[81] 419
421 431 433
439
[86] 443
449 457 461
463
[91] 467
479 487 491
499
[96] 503
509 521 523
541
[101] 547
557 563 569
571
[106] 577
587 593 599
601
[111] 607
613 617 619
631
[116] 641
643 647 653
659
[121] 661
673 677 683
691
[126] 701
709 719 727
733
[131] 739
743 751 757
761
[136] 769
773 787 797
809
[141] 811
821 823 827
829
[146] 839
853 857 859
863
[151] 877
881 883 887
907
[156] 911
919 929 937
941
[161] 947
953 967 971
977
[166] 983
991 997
1009 1013
[171] 1019
1021 1031
1033 1039
[176] 1049
1051 1061
1063 1069
[181] 1087
1091 1093
1097 1103
[186] 1109
1117 1123
1129 1151
[191] 1153
1163 1171
1181 1187
[196] 1193
1201 1213
1217 1223
[201] 1229
1231 1237
1249 1259
[206] 1277
1279 1283
1289 1291
[211] 1297
1301 1303
1307 1319
[216] 1321
1327 1361
1367 1373
[221] 1381
1399 1409
1423 1427
[226] 1429
1433 1439
1447 1451
[231] 1453
1459 1471
1481 1483
[236] 1487
1489 1493
1499 1511
[241] 1523
1531 1543
1549 1553
[246] 1559
1567 1571
1579 1583
[251] 1597
1601 1607
1609 1613
[256] 1619
1621 1627
1637 1657
[261] 1663
1667 1669
1693 1697
[266] 1699
1709 1721
1723 1733
[271] 1741
1747 1753
1759 1777
[276] 1783
1787 1789
1801 1811
[281] 1823
1831 1847
1861 1867
[286] 1871
1873 1877
1879 1889
[291] 1901
1907 1913
1931 1933
[296] 1949
1951 1973
1979 1987
[301] 1993
1997 1999
2003

[1] 304

[1] 25

[1] 143

> primes El data set “primes” contiene números [1] 2 3


>p primos del 2 al 2003. 5 7 11
> p+2 “p” despliega los números primos del 2 [6] 13 17
> primes[-1] al 19; “p+2” arroja los mismos valores 19 23 29
que “p” pero sumándole dos a cada [11] 31 37
> n=length(primes) uno. 41 43 47
> -n Con “primes[-1]” omitimos el primer [16] 53 59
numero,en este caso el 2, del conjunto 61 67 71
> primes[-1]-primes[-n] de números primos desplegados. [21] 73 79
83 89 97
>sum(primes[-1]-primes[-n]==2) “primes[-1]-primes[-n]” permite [26] 101
obtener un vector con la diferencia 103 107 109
entre dos números primos que están 113
juntos con lo que conocemos cuantos [31] 127
elementos son iguales a 2 en el mismo 131 137 139
vector y a la vez se conoce cuantos 149
primos iguales hay. [36] 151
157 163 167
173
[41] 179
181 191 193
197
[46] 199
211 223 227
229
[51] 233
239 241 251
257
[56] 263
269 271 277
281
[61] 283
293 307 311
313
[66] 317
331 337 347
349
[71] 353
359 367 373
379
[76] 383
389 397 401
409
[81] 419
421 431 433
439
[86] 443
449 457 461
463
[91] 467
479 487 491
499
[96] 503
509 521 523
541
[101] 547
557 563 569
571
[106] 577
587 593 599
601
[111] 607
613 617 619
631
[116] 641
643 647 653
659
[121] 661
673 677 683
691
[126] 701
709 719 727
733
[131] 739
743 751 757
761
[136] 769
773 787 797
809
[141] 811
821 823 827
829
[146] 839
853 857 859
863
[151] 877
881 883 887
907
[156] 911
919 929 937
941
[161] 947
953 967 971
977
[166] 983
991 997
1009 1013
[171] 1019
1021 1031
1033 1039
[176] 1049
1051 1061
1063 1069
[181] 1087
1091 1093
1097 1103
[186] 1109
1117 1123
1129 1151
[191] 1153
1163 1171
1181 1187
[196] 1193
1201 1213
1217 1223
[201] 1229
1231 1237
1249 1259
[206] 1277
1279 1283
1289 1291
[211] 1297
1301 1303
1307 1319
[216] 1321
1327 1361
1367 1373
[221] 1381
1399 1409
1423 1427
[226] 1429
1433 1439
1447 1451
[231] 1453
1459 1471
1481 1483
[236] 1487
1489 1493
1499 1511
[241] 1523
1531 1543
1549 1553
[246] 1559
1567 1571
1579 1583
[251] 1597
1601 1607
1609 1613
[256] 1619
1621 1627
1637 1657
[261] 1663
1667 1669
1693 1697
[266] 1699
1709 1721
1723 1733
[271] 1741
1747 1753
1759 1777
[276] 1783
1787 1789
1801 1811
[281] 1823
1831 1847
1861 1867
[286] 1871
1873 1877
1879 1889
[291] 1901
1907 1913
1931 1933
[296] 1949
1951 1973
1979 1987
[301] 1993
1997 1999
2003

[1] 2 3 5 7
11 13 17 19

[1] 4 5 7 9
13 15 19 21

[1] 3 5
7 11 13
[6] 17 19
23 29 31
[11] 37 41
43 47 53
[16] 59 61
67 71 73
[21] 79 83
89 97 101
[26] 103
107 109 113
127
[31] 131
137 139 149
151
[36] 157
163 167 173
179
[41] 181
191 193 197
199
[46] 211
223 227 229
233
[51] 239
241 251 257
263
[56] 269
271 277 281
283
[61] 293
307 311 313
317
[66] 331
337 347 349
353
[71] 359
367 373 379
383
[76] 389
397 401 409
419
[81] 421
431 433 439
443
[86] 449
457 461 463
467
[91] 479
487 491 499
503
[96] 509
521 523 541
547
[101] 557
563 569 571
577
[106] 587
593 599 601
607
[111] 613
617 619 631
641
[116] 643
647 653 659
661
[121] 673
677 683 691
701
[126] 709
719 727 733
739
[131] 743
751 757 761
769
[136] 773
787 797 809
811
[141] 821
823 827 829
839
[146] 853
857 859 863
877
[151] 881
883 887 907
911
[156] 919
929 937 941
947
[161] 953
967 971 977
983
[166] 991
997 1009
1013 1019
[171] 1021
1031 1033
1039 1049
[176] 1051
1061 1063
1069 1087
[181] 1091
1093 1097
1103 1109
[186] 1117
1123 1129
1151 1153
[191] 1163
1171 1181
1187 1193
[196] 1201
1213 1217
1223 1229
[201] 1231
1237 1249
1259 1277
[206] 1279
1283 1289
1291 1297
[211] 1301
1303 1307
1319 1321
[216] 1327
1361 1367
1373 1381
[221] 1399
1409 1423
1427 1429
[226] 1433
1439 1447
1451 1453
[231] 1459
1471 1481
1483 1487
[236] 1489
1493 1499
1511 1523
[241] 1531
1543 1549
1553 1559
[246] 1567
1571 1579
1583 1597
[251] 1601
1607 1609
1613 1619
[256] 1621
1627 1637
1657 1663
[261] 1667
1669 1693
1697 1699
[266] 1709
1721 1723
1733 1741
[271] 1747
1753 1759
1777 1783
[276] 1787
1789 1801
1811 1823
[281] 1831
1847 1861
1867 1871
[286] 1873
1877 1879
1889 1901
[291] 1907
1913 1931
1933 1949
[296] 1951
1973 1979
1987 1993
[301] 1997
1999 2003

[1] -304

[1] 1 2 2
4 2 4 2 4 6
[10] 2 6 4
2 4 6 6 2 6
[19] 4 2 6
4 6 8 4 2 4
[28] 2 4 14
4 6 2 10 2
6
[37] 6 4 6
6 2 10 2 4
2
[46] 12 12 4
2 4 6 2 10
6
[55] 6 6 2
6 4 2 10 14
4
[64] 2 4 14
6 10 2 4 6
8
[73] 6 6 4
6 8 4 8 10
2
[82] 10 2 6
4 6 8 4 2 4
[91] 12 8 4
8 4 6 12 2
18
[100] 6 10 6
6 2 6 10 6
6
[109] 2 6 6
4 2 12 10 2
4
[118] 6 6 2
12 4 6 8 10
8
[127] 10 8 6
6 4 8 6 4 8
[136] 4 14
10 12 2 10 2
4 2
[145] 10 14
4 2 4 14 4
2 4
[154] 20 4 8
10 8 4 6 6
14
[163] 4 6 6
8 6 12 4 6
2
[172] 10 2 6
10 2 10 2 6
18
[181] 4 2 4
6 6 8 6 6
22
[190] 2 10 8
10 6 6 8 12
4
[199] 6 6 2
6 12 10 18 2
4
[208] 6 2 6
4 2 4 12 2
6
[217] 34 6 6
8 18 10 14 4
2
[226] 4 6 8
4 2 6 12 10
2
[235] 4 2 4
6 12 12 8 12
6
[244] 4 6 8
4 8 4 14 4
6
[253] 2 4 6
2 6 10 20 6
4
[262] 2 24 4
2 10 12 2 10
8
[271] 6 6 6
18 6 4 2 12
10
[280] 12 8
16 14 6 4 2
4 2
[289] 10 12
6 6 18 2 16
2 22
[298] 6 8 6
4 2 4

[1] 61
>treering “Treering” contiene anchos de anillos Time Series:
de arboles en unidades sin Start = -6000
>length(treering) dimensiones. End = 1979
>min(treering) Con “length(treering)” obtenemos el Frequency =
numero total de observaciones. 1
>max(treering) Con “min(treering)” obtenemos el [1] 1.345
numero de observación mas bajo. 1.077 1.545
>sum(treering>1.5) Con “max(treering)” obtenemos el 1.319
numero de observación mas alto. [5] 1.413
Con “sum(treering>1.5)” conocemos 1.069 0.489
cuantas observaciones son mayores a 1.171
1.5. [9] 0.887
0.493 0.346
0.846
[13] 0.837
0.079 0.829
0.919
[17] 0.776
0.081 0.876
0.254
[21] 1.092
0.659 0.900
0.732
[25] 0.703
0.690 0.581
0.834
[29] 0.838
0.600 0.611
0.704
[33] 0.517
0.525 1.086
0.849
[37] 0.183
0.823 0.433
0.849
[41] 1.021
0.813 0.675
0.479
[45] 0.824
0.473 1.010
1.297
[49] 0.917
0.457 0.866
1.121
[53] 1.301
1.017 0.676
0.816
[57] 1.365
0.759 0.791
1.016
[61] 0.959
0.966 1.355
0.966
[65] 0.771
0.561 1.712
1.514
[69] 0.677
0.613 1.265
0.342
[73] 0.918
1.346 0.786
0.557
[77] 1.444
1.516 1.329
1.071
[81] 1.105
1.211 1.491
1.105
[85] 1.285
1.202 1.587
0.663
[89] 1.139
1.073 0.659
0.821
[93] 1.080
1.149 0.863
0.889
[97] 1.175
0.938 1.007
1.180
[101] 1.230
1.249 1.435
0.418
[105] 0.590
0.576 1.001
0.138
[109] 1.356
0.914 0.637
1.170
[113] 0.841
0.880 0.894
0.889
[117] 0.482
0.170 1.148
0.905
[121] 0.642
0.717 0.107
0.686
[125] 0.254
0.961 0.789
1.121
[129] 1.362
1.047 1.082
0.239
[133] 0.621
0.471 0.744
0.450
[137] 1.167
1.130 1.039
0.329
[141] 1.351
1.150 0.998
1.052
[145] 1.283
1.245 1.395
1.223
[149] 0.593
1.325 0.741
1.533
[153] 1.480
1.311 0.970
0.924
[157] 1.219
1.337 0.671
1.195
[161] 0.999
1.299 1.317
1.785
[165] 0.711
1.196 1.144
1.036
[169] 1.285
1.070 1.076
0.758
[173] 0.348
0.826 0.923
1.108
[177] 1.294
1.320 1.061
0.418
[181] 1.205
0.212 1.315
1.186
[185] 0.995
0.914 0.728
1.068
[189] 0.896
0.881 0.483
0.490
[193] 1.095
1.379 0.832
1.101
[197] 0.876
0.992 1.013
0.873
[201] 1.065
0.621 1.041
1.108
[205] 1.114
1.082 0.851
1.085
[209] 1.390
1.406 1.163
1.387
[213] 1.357
0.463 0.547
1.277
[217] 1.108
0.996 1.085
1.391
[221] 1.075
0.913 1.299
1.259
[225] 1.320
1.122 1.491
1.298
[229] 1.112
1.305 1.133
1.180
[233] 1.284
1.276 1.099
0.881
[237] 1.000
1.173 1.130
1.084
[241] 0.999
1.235 1.119
1.049
[245] 1.089
1.233 1.304
1.280
[249] 1.208
0.874 0.962
1.372
[253] 1.224
1.117 1.121
1.480
[257] 1.675
1.298 0.996
1.306
[261] 1.027
0.823 1.424
1.041
[265] 0.463
1.130 0.909
1.369
[269] 0.982
1.080 1.419
1.286
[273] 1.581
0.875 0.359
0.319
[277] 0.874
1.145 0.807
0.964
[281] 0.892
0.442 0.948
1.013
[285] 0.897
1.153 1.145
0.628
[289] 0.325
1.325 1.047
0.911
[293] 1.376
0.975 1.099
0.632
[297] 0.934
1.175 0.810
0.855
[301] 1.407
1.126 1.148
0.787
[305] 0.835
1.101 0.761
0.907
[309] 1.149
0.865 0.785
1.250
[313] 0.646
0.937 0.925
0.792
[317] 1.212
0.987 0.409
1.062
[321] 0.634
1.006 1.210
1.315
[325] 0.960
0.470 1.010
0.729
[329] 1.212
0.851 1.114
1.016
[333] 0.954
0.380 1.178
1.251
[337] 1.194
1.103 1.258
0.836
[341] 1.136
0.884 0.498
0.084
[345] 1.286
0.490 1.037
0.986
[349] 1.073
0.381 1.001
0.878
[353] 1.136
0.783 0.917
0.802
[357] 0.866
0.728 1.264
1.203
[361] 1.402
1.347 1.234
1.069
[365] 1.356
1.526 1.345
0.790
[369] 1.500
0.752 0.940
1.121
[373] 1.186
1.065 1.164
1.469
[377] 0.817
0.185 1.433
1.555
[381] 1.201
1.317 0.955
1.005
[385] 0.901
0.821 0.479
0.750
[389] 0.182
0.936 1.058
1.074
[393] 0.934
0.903 0.309
0.786
[397] 0.585
0.811 0.969
1.089
[401] 0.581
0.990 0.900
0.800
[405] 0.771
0.919 0.800
0.658
[409] 0.328
0.698 0.929
0.677
[413] 0.401
1.109 0.274
0.668
[417] 0.960
0.221 1.025
1.083
[421] 0.593
0.994 0.861
0.588
[425] 0.923
1.107 0.693
0.882
[429] 0.591
0.660 1.075
1.146
[433] 0.965
0.795 1.061
0.946
[437] 0.705
0.744 1.063
1.182
[441] 1.136
1.229 0.653
0.892
[445] 0.696
0.465 0.962
1.170
[449] 0.911
1.293 1.088
0.853
[453] 1.146
0.578 0.900
0.975
[457] 1.191
0.481 0.155
1.455
[461] 1.233
0.930 1.131
1.304
[465] 1.393
1.128 0.801
1.619
[469] 1.423
1.606 1.395
1.291
[473] 1.456
1.674 1.256
1.135
[477] 1.190
1.167 1.065
1.292
[481] 0.575
1.505 1.239
0.993
[485] 0.925
0.988 1.171
1.133
[489] 1.412
1.070 1.272
0.790
[493] 1.082
1.179 1.109
1.588
[497] 1.053
1.123 1.246
1.361
[501] 0.860
0.146 1.252
1.350
[505] 0.907
1.464 1.067
0.827
[509] 0.769
0.875 0.668
0.999
[513] 1.252
1.439 1.206
0.797
[517] 0.724
0.867 1.333
1.306
[521] 1.058
1.440 1.239
1.611
[525] 1.403
0.754 0.129
1.075
[529] 0.841
0.752 1.446
1.010
[533] 1.034
1.016 0.396
1.101
[537] 0.645
1.342 1.146
0.943
[541] 0.755
1.406 0.860
0.890
[545] 1.010
0.850 0.444
0.573
[549] 0.190
0.985 0.873
1.209
[553] 0.689
0.604 1.035
1.120
[557] 1.138
0.935 0.268
1.051
[561] 0.935
0.679 0.909
0.819
[565] 1.106
1.024 1.352
0.796
[569] 1.122
1.472 1.342
1.404
[573] 0.978
0.612 1.077
1.020
[577] 1.311
1.279 0.648
1.193
[581] 0.761
1.070 0.716
0.804
[585] 1.326
1.551 0.858
0.406
[589] 0.851
1.007 0.955
0.612
[593] 1.029
0.619 1.024
1.256
[597] 1.022
1.063 0.631
0.788
[601] 1.154
1.336 1.206
0.955
[605] 0.992
0.680 1.042
1.225
[609] 1.762
1.018 0.684
0.097
[613] 1.079
0.888 1.080
1.205
[617] 0.927
0.926 1.320
1.407
[621] 1.014
0.812 1.152
1.351
[625] 1.013
0.183 0.362
1.059
[629] 1.280
0.002 0.938
1.009
[633] 0.830
1.300 1.058
0.691
[637] 0.809
0.217 0.157
0.588
[641] 0.748
1.109 1.096
0.626
[645] 0.907
0.767 1.178
0.887
[649] 0.599
0.930 1.149
1.052
[653] 1.187
1.309 0.973
0.908
[657] 1.330
0.624 1.660
0.967
[661] 1.397
1.289 1.587
1.517
[665] 1.254
1.077 1.147
1.234
[669] 1.646
1.657 1.844
1.288
[673] 0.875
1.053 1.229
1.051
[677] 1.665
0.298 1.272
1.277
[681] 1.458
1.139 0.613
0.091
[685] 0.803
0.251 0.877
0.875
[689] 0.909
0.371 1.433
1.517
[693] 1.119
1.316 1.265
1.187
[697] 1.225
1.064 0.793
1.148
[701] 0.761
1.264 0.681
1.103
[705] 0.339
0.930 1.182
1.540
[709] 1.397
1.429 0.573
1.658
[713] 1.243
1.339 1.433
1.484
[717] 0.652
1.185 1.416
1.365
[721] 0.959
1.065 1.047
1.396
[725] 0.215
1.383 0.943
1.474
[729] 1.136
1.134 1.339
1.633
[733] 0.853
1.684 1.172
1.730
[737] 1.850
1.555 1.422
0.894
[741] 0.578
1.081 0.738
1.175
[745] 1.247
0.306 1.275
0.752
[749] 1.071
0.632 0.702
1.505
[753] 0.729
0.918 0.410
0.373
[757] 0.601
1.158 0.571
1.324
[761] 0.267
1.039 0.803
0.886
[765] 0.511
0.723 1.045
1.121
[769] 0.959
1.006 0.829
0.970
[773] 1.360
1.048 1.179
0.542
[777] 1.229
0.630 0.360
0.790
[781] 1.051
0.660 1.181
1.512
[785] 1.302
1.403 1.289
0.914
[789] 1.020
0.916 0.026
0.749
[793] 0.837
0.357 0.591
0.555
[797] 0.560
0.791 0.691
0.585
[801] 0.741
0.967 0.906
0.865
[805] 1.161
0.563 1.045
0.691
[809] 0.957
1.117 1.269
0.638
[813] 1.119
0.810 1.272
0.007
[817] 0.801
1.149 0.423
1.400
[821] 0.954
0.905 1.349
1.342
[825] 0.496
0.615 0.463
0.857
[829] 1.263
1.022 0.952
0.807
[833] 1.007
1.069 1.425
0.377
[837] 0.661
0.896 1.373
1.205
[841] 1.387
1.514 0.719
1.183
[845] 0.726
1.178 1.102
1.185
[849] 1.497
0.687 1.377
1.438
[853] 1.564
1.224 0.617
1.647
[857] 1.640
0.849 0.870
1.004
[861] 0.769
0.650 0.962
0.433
[865] 1.129
1.427 0.702
0.964
[869] 1.326
1.012 0.754
0.791
[873] 0.559
1.027 0.420
1.436
[877] 0.729
0.964 1.282
1.053
[881] 0.943
0.427 0.161
0.839
[885] 1.160
0.908 1.477
1.292
[889] 1.344
1.354 0.546
1.412
[893] 0.451
1.158 1.526
1.626
[897] 1.221
0.861 1.027
0.584
[901] 0.133
0.834 1.111
1.212
[905] 1.366
1.586 1.153
0.523
[909] 0.712
1.042 1.082
1.675
[913] 1.236
1.125 0.328
1.316
[917] 1.116
0.929 1.077
1.003
[921] 1.263
0.752 1.231
0.491
[925] 1.139
1.417 1.472
1.156
[929] 1.080
1.619 1.004
1.077
[933] 0.425
0.914 1.041
1.242
[937] 1.356
0.737 0.927
0.853
[941] 1.294
1.307 1.197
0.847
[945] 0.733
0.400 1.038
0.944
[949] 1.237
1.299 1.126
0.534
[953] 1.394
1.323 1.007
1.642
[957] 1.043
1.045 0.971
1.219
[961] 1.091
0.482 0.927
1.104
[965] 1.194
1.445 1.442
1.300
[969] 0.800
0.206 1.321
1.233
[973] 0.986
0.521 1.177
0.191
[977] 0.896
0.666 0.880
1.023
[981] 1.592
0.764 0.851
0.783
[985] 0.869
0.606 1.160
0.946
[989] 0.628
0.897 1.067
1.046
[993] 1.368
1.624 1.719
1.029
[997] 0.912
0.974 1.620
1.558
[ reached
getOption("m
ax.print") --
omitted 6980
entries ]
[1] 7980

[1] 0

[1] 1.908

[1] 219
>mandms “mandms” contiene datos sobre la
distribución de color en una bolsa de blue brown
M&M’s como porcentajes para varios milk
>names(which(rowSums(mandms== tipos de paquetes. chocolate
0)==1)) 10.0000
Con 30.0000
> “names(which(rowSums(mandms==0 Peanut
names(which(rowSums(mandms==r )==1))” conocemos a cual de los 20.0000
owMeans(mandms))==6)) paquetes le hace falta un color. 20.0000
Peanut Butter
Con 20.0000
> “names(which(rowSums(mandms==r 20.0000
names(which(rowSums(mandms== owMeans(mandms))==6))” Almond
max(mandms))==1)) conocemos cual paquete posee una 16.6667
distribución igual de colores. 16.6667
>names(which(colSums(mandms== kid minis
max(mandms))==1)) Con 16.6667
“names(which(rowSums(mandms== 16.6667
max(mandms))==1))” da a conocer el
paquete con el color mas común que green orange
cualquier otro. milk
chocolate
>Con 10.0000
“names(which(colSums(mandms==m 10.0000
ax(mandms))==1))” conocemos dicho Peanut
color. 10.0000
10.0000
Peanut Butter
20.0000
0.0000
Almond
16.6667
16.6667
kid minis
16.6667
16.6667

red yellow
milk
chocolate
20.0000
20.0000
Peanut
20.0000
20.0000
Peanut Butter
20.0000
20.0000
Almond
16.6667
16.6667
kid minis
16.6667
16.6667

[1] "Peanut
Butter"

[1] "Almond"
"kid minis"

[1] "milk
chocolate"

[1] "brown"
> data("nym.2002") En “data(“nym.2002”) se hace [1] 1000
> length(nym.2002$time) referencia al lugar donde se almacenan
los datos de los tiempos registrados en [1] 147.3333
> fastest<-min(nym.2002$time) la maratón.
> fastest [1] "2:27"
Con “length(nym.2002$time)”
> paste(fastest %/% 60, obtenemos la cantidad de tiempos [1] 566.7833
round(fastest %% 60),sep=":") almacenados en el data set.
[1] "9:27"
> slowest <- max(nym.2002$time) Con “fastest<-min(nym.2002$time)” y
> slowest “fastest” obtenemos el tiempo mas
rápido.
> paste(slowest %/% 60,
round(slowest %% 60), sep=":") “paste(fastest %/% 60, round(fastest
[1] "9:27" %% 60),sep=":")” es la función que
nos permite hacer la conversión a
horas y minutos.

Con “slowest <-


max(nym.2002$time)” y “slowest”
obtenemos el tiempo más lento.

“paste(slowest %/% 60, round(slowest


%% 60), sep=":")” es la función que
nos permite hacer la conversión a
horas y minutos.

> rivers “rivers” contiene informacion acerca [1] 735


de la longitude de algunos ríos. 320 325 392
> max(rivers) 524
Con “max(rivers)” conocemos cuál es [6] 450
> min(rivers) el rio mas grande. 1459 135
465 600
Con “min(rivers)” conocemos cuál es [11] 330
el rio mas pequeño. 336 280 315
870
[16] 906
202 329 290
1000
[21] 600
505 1450
840 1243
[26] 890
350 407 286
280
[31] 525
720 390 250
327
[36] 230
265 850 210
630
[41] 260
230 360 730
600
[46] 306
390 420 291
710
[51] 340
217 281 352
259
[56] 250
470 680 570
350
[61] 300
560 900 625
332
[66] 2348
1171 3710
2315 2533
[71] 780
280 410 460
260
[76] 255
431 350 760
618
[81] 338
981 1306
500 696
[86] 605
250 411
1054 735
[91] 233
435 490 310
460
[96] 383
375 1270
545 445
[101] 1885
380 300 380
377
[106] 425
276 210 800
420
[111] 350
360 538
1100 1205
[116] 314
237 610 360
540
[121] 1038
424 310 300
444
[126] 301
268 620 215
652
[131] 900
525 246 360
529
[136] 500
720 270 430
671
[141] 1770

[1] 3710

[1] 135

> uspop “uspop” contiene datos de la poblacion Time Series:


estadounidense década a década de Start = 1790
>names(uspop)=c(seq(1790,1970,by 1790 a 1970. End = 1970
=10)) Con Frequency =
“names(uspop)=c(seq(1790,1970,by=1 0.1
> names(uspop) 0))” y “names(uspop)” van contándose [1] 3.93
> diff(uspop) los años desde 1790 a 1970 de 10 en 5.31 7.24
> min(diff(uspop)) 10. 9.64
[1] 1.38 Con “diff(uspop)” conocemos las [5] 12.90
diferencias entre décadas y con 17.10 23.20
“min(diff(uspop))” conocemos que 31.40
1.38 fue el menor incremento [9] 39.80
correspondiendo a la década de 1790 a 50.20 62.90
1800. 76.00
Es visible que a pesar de que en ciertas [13] 92.00
décadas se dan bajas en el incremento 105.70
de población, en general se muestra un 122.80
patrón de incremento poblacional y a 131.70
la década mas reciente se nota que ha [17] 151.30
habido un incremento demográfico. 179.30
203.20

[1] "1790"
"1800"
"1810"
"1820"
[5] "1830"
"1840"
"1850"
"1860"
[9] "1870"
"1880"
"1890"
"1900"
[13] "1910"
"1920"
"1930"
"1940"
[17] "1950"
"1960"
"1970"

Time Series:
Start = 1800
End = 1970
Frequency =
0.1
[1] 1.38
1.93 2.40
3.26
[5] 4.20
6.10 8.20
8.40
[9] 10.40
12.70 13.10
16.00
[13] 13.70
17.10 8.90
19.60
[17] 28.00
23.90

[1] 1.38