MakeSearchPattern
探索対象k人について、i人探索のパターン数(k,i)として、(k,1)+(k,2)+...+(k,k)通りの探索パターンを作成する
MakeSearchPattern(v)
MakeSearchPattern<-function(v){
library(gtools)
nt<-length(v)
x<-0
X<-NULL
for(i in 1:nt){
tmp<-combinations(nt,i)
tmp2<-tmp
tmp2[1:length(tmp2)]<-c(v[tmp])
X[[i]]<-tmp2
x<-sum(x,length(as.matrix(X[[i]])[,1]))
}
list(X=X,x=x)
}
\name{MakeSearchPattern}
\alias{MakeSearchPattern}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
MakeSearchPattern
}
\description{
探索対象k人について、i人探索のパターン数(k,i)として、(k,1)+(k,2)+...+(k,k)通りの探索パターンを作成する
}
\usage{
MakeSearchPattern(v)
}
\arguments{
自然数ベクトル
}
%- maybe also 'usage' for other objects documented here.
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
リスト。リストの各要素は行列。
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%% ~~who you are~~
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
}
\examples{
# needs kinship package
v<-c(3,5)
MakeSearchPattern(v)
}