uniquewt.df: Elimination of Duplicated Rows in a Array

uniquewt.dfR Documentation

Elimination of Duplicated Rows in a Array

Description

An utility function to eliminate the duplicated rows in a array.

Usage

uniquewt.df(x)

Arguments

x

a data frame which contains duplicated rows

Value

The function returns a y which contains once each duplicated row of x.
y is an attribut 'factor' which gives the number of the row of y in which each row of x is found
y is an attribut 'length.class' which gives the number of duplicates in x with an attribut of each row of y with an attribut

Author(s)

Daniel Chessel

Examples

data(ecomor)
forsub.r <- uniquewt.df(ecomor$forsub)
attr(forsub.r, "factor")
forsub.r[1,]
ecomor$forsub[126,] #idem

dudi.pca(ecomor$forsub, scale = FALSE, scann = FALSE)$eig
# [1] 0.36845 0.24340 0.15855 0.09052 0.07970 0.04490
w1 <- attr(forsub.r, "len.class") / sum(attr(forsub.r,"len.class"))
dudi.pca(forsub.r, row.w = w1, scale = FALSE, scann = FALSE)$eig
# [1] 0.36845 0.24340 0.15855 0.09052 0.07970 0.04490

sdray/ade4 documentation built on March 30, 2024, 12:33 a.m.