複数のメンバーが探索対象のときには、その全員もしくは一部を探索対象とすることが必要。そのパターンを網羅する

  • 予定パッケージ名
    • HigashiNopponLikelihood
  • 関数名
    • MakeSearchPattern
  • タイトル
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]]<-matrix(tmp2,nrow=length(tmp[,1]))
		X[[i]]<-tmp2
		x<-sum(x,length(as.matrix(X[[i]])[,1]))
	}
	list(X=X,x=x)
}
  • Rdファイル
\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)
}