#' plot X[,1:2] with id
#'
#'
#' @param X    matrix whose rows will be plotted
#' @param id   id of the rows of X
#' @param asp  aspect ratio
#' @param type type of the plot
#' @param pos  position of the text
#' @param cex  size of the text
#' @param col  color of the text
#' @param ...  additional graphical paramaters to text function
#'
#' @details
#' Equivalent to:
#' \preformatted{
#' plot( X[,1:2], type="n", asp=1 )
#' text( X[,1],X[,2], labels=id, ... )
#' }
#'
#' @examples
#'  X=matrix(c(
#' -1,  1,  0,  1,  1,    1, -1,   0, 0,  0, 1, 0, -1, -1, 0, -1, 1, -1
#' , -.5,  .5, .5,  .5, -.5,  -.5, .5,  -.5, -2,  0, 2,  0
#' ),,2,byrow=1)
#' idplot(X, id=paste("s",1:nrow(X),sep=""))
#' idplot(X, id=paste("s",1:nrow(X),sep=""), pos=1)
#' idplot(X, id=paste("s",1:nrow(X),sep=""), pos=2, cex=2)
#'
#' @return
#' none
#'
#' @export
#'

idplot <- function( X, id=NULL, type="n", asp=1, pos=NULL, cex=1, col=NULL
                    , ... ){
 # plot X[,1:2] with id
 # Shin-ichi Mayekawa
 # 20260223,0301
 # ... in plot: 20260409
 # 20260509,11
 #

 if( is.null(id) ){
  if( is.null(rownames(X)) ) id=1:nrow(X)
  else id=rownames(X)
 }
 plot( X[,1:2], type=type, asp=asp, ... )
 text( X[,1],X[,2], labels=id, pos=pos, cex=cex, col=col )

} # end of idplot


