\documentclass[a4paper, oneside, 10pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\date{\today}
\title{}
\author{}
\begin{document}



função

size.cluster = function(x,y)\{
\begin{verbatim}
dados1 = aggregate(.~ Perna, data=x, sum)
\end{verbatim}


\#\# Soma as medidas de cada articulo da perna, fornecidas pelo usuário
\begin{verbatim}
dados2 = apply(dados1, MARGIN=2, FUN=prod)
\end{verbatim}


\#\# Multiplica as medidas de cada perna, para ter um total para cada individuo
\begin{verbatim}
library(cluster)
\end{verbatim}


\#\# Chama a função para fazer uma distribuição de clusters
\begin{verbatim}
pam.res=pam(scale(dados2),y)
\end{verbatim}


\#\# escala os dados e calcula o PAM para y grupos de dados
\begin{verbatim}
pam.res$medoids
\end{verbatim}


\#\# tira as ,,medoids", ,,médias" inseridas em um data.set
\begin{verbatim}
head(pam.res$cluster)
\end{verbatim}


\#\# busca os vetores de agrupamento 
\begin{verbatim}
final = clusplot(pam.res, main = "Cluster plot, k = y", 
       color = TRUE)
\end{verbatim}


\#\# faz o gráfico dos y agrupamentos.
\begin{verbatim}
return(final)
\end{verbatim}


\}

HELP

Cluster size analises

Description

size.cluster returns a cluster graphic for the multiplicative size for all legs in a arthropod, after making the sum of all the segments in each leg.
Usage

size.cluster (x,y)
Arguments

x	Data table for the size of each leg segment, of each animal
y	Number of data groups expected to be clustered

Details

This function is used to analize the results of the measurements done with imagej software. The resulting table, with the measurements of each segment in a animal leg is summed, and the total size of each leg is multiplied and the resulting number is compared to the other animals.

Value

It facilitates the work of comparing the results for size comparison photographs for arthropods

References

Gnaspini, P. (1996). Population ecology of  Goniosomu spelueum,  a cavernicolous harvestman fromsouth-eastern Brazil (Arachnida: Opiliones: Gonyleptidae. J.  Zool., Lond.  239,417-435.

\end{document}
