amap/ 0000755 0001762 0000144 00000000000 14326676332 011204 5 ustar ligges users amap/NAMESPACE 0000644 0001762 0000144 00000001106 13275576575 012433 0 ustar ligges users useDynLib(amap, .registration = TRUE, .fixes = "C_")
export("Kmeans","acp","pca","K","W","varrob",
"acpgen","acprob","plot2","plotAll",
"plot.acp","print.acp","biplot.acp","pop","diss")
S3method("print","acp")
S3method("plot","acp")
S3method("biplot","acp")
S3method("print","pop")
export("Dist","hcluster","hclusterpar")
export("matlogic","burt","afc")
importFrom("graphics", "arrows", "axis", "barplot", "box", "lines",
"par", "plot", "plot.new", "plot.window", "points", "text",
"title")
importFrom("stats", "biplot", "sd", "var")
amap/demo/ 0000755 0001762 0000144 00000000000 12444343274 012123 5 ustar ligges users amap/demo/amap.R 0000755 0001762 0000144 00000003557 10336325616 013177 0 ustar ligges users ###################################################
### chunk number 1:
###################################################
cat("\n------ CLUSTERING TOOLS -------\n")
cat("\n------ Hierarchical clustering -------\n")
data(USArrests)
h = hcluster(USArrests)
plot(h)
readline("Next")
###################################################
### chunk number 2:
###################################################
cat("\n------ Hierarchical clustering using function heatmap -------\n")
heatmap(as.matrix(USArrests),
hclustfun=hcluster,
distfun=function(u){u})
readline("Next")
###################################################
### chunk number 3:
###################################################
cat("\n------ Parralelized Hierarchical clustering -------\n")
h = hclusterpar(USArrests,nbproc=4)
readline("Next")
###################################################
### chunk number 4:
###################################################
cat("\n------ K-means clustering -------\n")
Kmeans(USArrests,centers=3,method="correlation")
readline("Next")
###################################################
### chunk number 5:
###################################################
cat("\n------ ROBUST TOOLS -------\n")
cat("\n------ A robust variance computation -------\n")
data(lubisch)
lubisch <- lubisch[,-c(1,8)]
varrob(scale(lubisch),h=1)
readline("Next")
###################################################
### chunk number 6:
###################################################
cat("\n------ A robust principal component analysis -------\n")
p <- acpgen(lubisch,h1=1,h2=1/sqrt(2))
plot(p)
readline("Next")
###################################################
### chunk number 6:
###################################################
cat("\n------ Another robust principal component analysis -------\n")
p <- acprob(lubisch,h=4)
plot(p)
readline("Next")
amap/demo/00Index 0000644 0001762 0000144 00000000026 10264436346 013254 0 ustar ligges users amap Amap demo file
amap/exec/ 0000755 0001762 0000144 00000000000 13466255342 012126 5 ustar ligges users amap/exec/amap.php 0000644 0001762 0000144 00000014370 13466255271 013563 0 ustar ligges users
Upload your data (text-tabulated file)
$MAX_FILE) exit("File size: $taillefichier; max allowed: $MAX_FILE"); } /* ================================== */ /* We write R code in file $ID/prog.R */ /* ================================== */ $fp=fopen("$ID/prog.R",'w'); fwrite($fp,"library(amap)\n"); fwrite($fp,"library(ctc)\n"); /* Read Data */ fwrite($fp,"data <- read.delim('$ID/data.txt',header=$HEADER,row.names=$ROWNAMES,sep='$SEP') \n" ); fwrite($fp,"data <- scale(data) \n"); fwrite($fp,"pca <- acprob(data,h=1) \n"); /* Number of columns to keep ( number of column to keep 90 % of * variance)*/ fwrite($fp,"cumVarNorm <- cumsum(pca\$sdev ^ 2) / sum(pca\$sdev ^ 2)\n"); fwrite($fp,"ncol <- max(which( cumVarNorm< 0.9)) +1 \n"); fwrite($fp,"ncol \n"); fwrite($fp,"data <- pca\$scores[,1:ncol] \n"); /* Hierarchical clustering */ fwrite($fp,"hr0 <- hclusterpar(data) \n"); fwrite($fp,"hc0 <- hclusterpar(t(data)) \n"); fwrite($fp,"hr <- as.dendrogram(hr0) \n"); fwrite($fp,"hc <- as.dendrogram(hc0) \n"); /* A pdf file */ fwrite($fp,"pdf(file='$ID/Rplots.pdf') \n"); fwrite($fp,"plot(pca) \n"); fwrite($fp,"biplot(pca) \n"); fwrite($fp,"plot2.acp(pca) \n"); fwrite($fp,"heatmap(as.matrix(data),Colv=hc,Rowv=hr) \n"); fwrite($fp,"dev.off() \n"); /* Some png images */ fwrite($fp,"bitmap(file='$ID/pcaplot.png') \n"); fwrite($fp,"plot(pca) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"bitmap(file='$ID/pcabiplot.png') \n"); fwrite($fp,"biplot(pca) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"bitmap(file='$ID/pcaplot2.png') \n"); fwrite($fp,"plot2.acp(pca) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"bitmap(file='$ID/heatmap.png') \n"); fwrite($fp,"heatmap(as.matrix(data),Colv=hc,Rowv=hr) \n"); fwrite($fp,"dev.off() \n"); fwrite($fp,"r2atr(hc0,file='$ID/cluster.atr') \n"); fwrite($fp,"r2gtr(hr0,file='$ID/cluster.gtr') \n"); fwrite($fp,"r2cdt(hr0,hc0,data ,file='$ID/cluster.cdt') \n"); fclose($fp); /* ===================== */ /* Send command (R batch)*/ /* ===================== */ system("$R_BIN --no-save < $ID/prog.R > $ID/prog.R.out 2> $ID/prog.R.warnings"); /* ===================================== */ /* We create html page including results */ /* ===================================== */ echo "";
echo "
";
echo "
";
echo "
";
echo "
"; echo "3 files for Freeview"; echo " or Treeview: "; echo "cdt "; echo "atr "; echo "gtr "; echo "
"; /* Signature */ echo "
This results made by amap, Code use: prog.R, Out: prog.R.out, Warnings: prog.R.warnings."; } ?>