Operators acting on objects to extract parts.

# S4 method for CA,ANY,missing
[[(x, i)

# S4 method for PCA,ANY,missing
[[(x, i)

Arguments

x

An object from which to extract element(s) or in which to replace element(s).

i

A character string specifying elements to extract. Any unambiguous substring can be given (see details).

Value

A list.

Details

If i is "data", returns a list with the following elements:

data

A numeric matrix of raw data.

mean

A numeric vector giving the variables means (PCA).

sd

A numeric vector giving the variables standard deviations (PCA).

If i is "rows", returns a list with the following elements:

coord

A numeric matrix of rows/individuals coordinates.

cos2

A numeric matrix of rows/individuals squared cosine.

masses

A numeric vector giving the rows masses/individual weights.

sup

A logical vector specifying whether a point is a supplementary observation or not.

If i is "columns", returns a list with the following elements:

coord

A numeric matrix of columns/variables coordinates.

cor

A numeric matrix of correlation between variables and the dimensions (PCA).

cos2

A numeric matrix of columns/variables squared cosine.

masses

A numeric vector giving the columns masses/variable weights.

sup

A logical vector specifying whether a point is a supplementary observation or not.

If i is "eigenvalues", returns a numeric vector of eigenvalues.

See also

Other mutator: mutator

Author

N. Frerebeau

Examples

## Load data
data("mississippi", package = "folio")

## Compute principal components analysis
X <- pca(mississippi, scale = TRUE, sup_row = 8:10, sup_col = 7:10)

## Get results for the individuals
X[["individuals"]]
#> NULL

## Compute correspondence analysis
Y <- ca(mississippi, sup_row = 8:10, sup_col = 7:10)

## Get results for the rows
Y[["rows"]]
#> $coordinates
#>                      F1          F2          F3          F4            F5
#> 10-P-1       0.63476459  0.73633440 -0.18667611 -0.16132977  0.0656217217
#> 11-N-9      -0.12169770 -0.28512184 -0.07856042 -0.03607450  0.0896117098
#> 11-N-1      -0.04595754 -0.19968749 -0.07970267  0.09115564  0.0847258272
#> 11-O-10     -0.25859302 -0.09304158 -0.08260003  0.11838467 -0.0553742492
#> 11-N-4      -0.24077386 -0.06750704 -0.06646524 -0.09513256 -0.0009655576
#> 13-N-5       1.16884200  0.48017952 -0.44457413  0.01683417  0.0206568191
#> 13-N-4       1.06533594  0.66178676 -0.14461260 -0.06657448  0.0388853355
#> 13-P-1       0.28884259 -0.50913975  0.39184795  0.05594568 -0.1473332892
#> 13-P-8       0.96636124 -0.11874858  0.77742337  0.07068909  0.0651207329
#> 13-P-10      0.89064524 -0.30796351  1.52627088  0.05944679  0.0625008518
#> 13-O-7      -0.09739016  0.10237009  0.12313237 -0.08052930 -0.0066372956
#> 13-O-5      -0.16060580 -0.03574911  0.12260043 -0.06836349 -0.0105672618
#> 13-N-21      0.43394022 -0.14097422 -0.32778812  0.09206517 -0.0305766900
#> 12-O-5       0.04007019  0.16140880  0.03623131  0.02899504  0.0258888730
#> Holden Lake -0.68130724  0.97589329  0.33270354  0.18407890  0.0096910911
#> 13-N-15      0.17347764  0.05475653 -0.13775105 -0.02116356 -0.0503738075
#> 12-N-3      -0.04612360  0.07557412 -0.11869423  0.06180249 -0.0358650762
#> 13-N-16      1.03902462  0.76782458 -0.12964824 -0.10734659  0.0071382023
#> 13-O-11      0.23313831  0.59943076  0.06375723 -0.23797577 -0.0340262000
#> 13-O-10      0.93548663  0.63519549  0.05334415 -0.12279379 -0.0888660561
#> 
#> $contributions
#>                      F1         F2          F3          F4           F5
#> 10-P-1       4.88885458  9.8278871  0.87061039  4.98057572  1.947769881
#> 11-N-9       0.92661289  7.5984118  0.79507090  1.28411265 18.729397358
#> 11-N-1       0.22645773  6.3870971  1.40243893 14.05106924 28.692332595
#> 11-O-10      3.52142686  0.6810320  0.73979281 11.63978029  6.019514299
#> 11-N-4       6.05782581  0.7114174  0.95049942 14.91506918  0.003631743
#> 13-N-5       8.90846967  2.2460892  2.65365517  0.02914364  0.103723952
#> 13-N-4      22.57639509 13.0150497  0.85656110  1.39048351  1.121279325
#> 13-P-1       2.34134701 10.8678984  8.87244031  1.38530439 22.709405016
#> 13-P-8      14.33693607  0.3234167 19.10544401  1.20990386  2.427037985
#> 13-P-10      5.30345539  0.9472752 32.06839808  0.37262765  0.973603130
#> 13-O-7       0.94336895  1.5571336  3.10499242 10.17250769  0.163340710
#> 13-O-5       3.56403788  0.2638022  4.27630256 10.18443894  0.575182231
#> 13-N-21      9.44991263  1.4899635 11.10245500  6.70853180  1.749079666
#> 12-O-5       0.05579424  1.3524748  0.09392457  0.46074714  0.868227338
#> Holden Lake 13.56293462 41.5719659  6.65958427 15.61508955  0.102299541
#> 13-N-15      3.16461476  0.4710141  4.10854690  0.74281368  9.947273380
#> 12-N-3       0.17155581  0.6880713  2.33928314  4.85780106  3.866901849
#> 
#> $cos2
#>                     F1         F2          F3           F4           F5
#> 10-P-1      0.39881987 0.53666292 0.034492836 0.0257620513 4.262326e-03
#> 11-N-9      0.13269934 0.72839175 0.055298287 0.0116601672 7.195046e-02
#> 11-N-1      0.03309067 0.62473198 0.099526288 0.1301844345 1.124666e-01
#> 11-O-10     0.67252960 0.08706267 0.068618026 0.1409511868 3.083852e-02
#> 11-N-4      0.76281006 0.05996473 0.058128200 0.1190847439 1.226744e-05
#> 13-N-5      0.76105855 0.12844397 0.110101906 0.0001578665 2.377023e-04
#> 13-N-4      0.70944459 0.27376724 0.013072469 0.0027705178 9.451854e-04
#> 13-P-1      0.16012363 0.49751592 0.294691848 0.0060071169 4.166148e-02
#> 13-P-8      0.59801870 0.00903010 0.387035618 0.0031999302 2.715653e-03
#> 13-P-10     0.24596611 0.02940792 0.722318935 0.0010957782 1.211261e-03
#> 13-O-7      0.22769954 0.25158122 0.363979149 0.1556825110 1.057583e-03
#> 13-O-5      0.55012044 0.02725623 0.320567343 0.0996744395 2.381553e-03
#> 13-N-21     0.57933698 0.06114358 0.330565755 0.0260772723 2.876420e-03
#> 12-O-5      0.05267424 0.85469250 0.043064911 0.0275805442 2.198780e-02
#> Holden Lake 0.29731888 0.61001589 0.070900832 0.0217042374 6.015640e-05
#> 13-N-15     0.54664049 0.05446113 0.344670868 0.0081356464 4.609187e-02
#> 12-N-3      0.07869590 0.21127683 0.521152539 0.1412920195 4.758271e-02
#> 13-N-16     0.63597409 0.34730559 0.009901956 0.0067883502 3.001687e-05
#> 13-O-11     0.11430180 0.75562069 0.008548398 0.1190943787 2.434741e-03
#> 13-O-10     0.67089493 0.30931014 0.002181488 0.0115593158 6.054122e-03
#> 
#> $masses
#>      10-P-1      11-N-9      11-N-1     11-O-10      11-N-4      13-N-5 
#> 0.012729477 0.065639072 0.112487011 0.055247662 0.109629373 0.006841011 
#>      13-N-4      13-O-7      13-O-5     13-N-21      12-O-5 Holden Lake 
#> 0.020869415 0.029442328 0.016106685 0.007014202 0.104347073 0.144960166 
#>     13-N-15      12-N-3     13-N-16     13-O-11     13-O-10 
#> 0.052649809 0.036456529 0.030654659 0.110322134 0.084603395 
#> 
#> $supplement
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [13] FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE
#>