# NOT RUN {
# Create a small 2D data set from 3 corner-points:
p1=c(1,2);p2=c(3,5);p3=c(7,3)
dp=rbind(p1,p2,p3);dp
set.seed(916070)
pts=t(sapply(1:20, function(i,dp){
cc=runif(3)
cc=cc/sum(cc)
colSums(dp*cc)
},dp))
df=data.frame(pts)
colnames(df)=c("x","y")
# Run AA:
aa=archetypal(df=df,kappas = 3,verbose=FALSE)
# Check B matrix:
B=aa$B
yy=check_Bmatrix(B)
yy$used_rows
yy$used_weights
#
# }
Run the code above in your browser using DataLab