P. 1
An Introduction to R

An Introduction to R

|Views: 55|Likes:
Published by juanmcferrin
Intoducción a R
Intoducción a R

More info:

Published by: juanmcferrin on Feb 05, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





The function eigen(Sm) calculates the eigenvalues and eigenvectors of a symmetric matrix
Sm. The result of this function is a list of two components named values and vectors.
The assignment

> ev <- eigen(Sm)

will assign this list to ev. Then ev$val is the vector of eigenvalues of Sm and ev$vec is the
matrix of corresponding eigenvectors. Had we only needed the eigenvalues we could have
used the assignment:

> evals <- eigen(Sm)$values

evals now holds the vector of eigenvalues and the second component is discarded. If the

> eigen(Sm)

is used by itself as a command the two components are printed, with their names. For large
matrices it is better to avoid computing the eigenvectors if they are not needed by using
the expression

> evals <- eigen(Sm, only.values = TRUE)$values

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->