% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pref2dist.R
\name{pref2dist}
\alias{pref2dist}
\title{Convert Japanese Prefecture to District}
\usage{
pref2dist(pref = NULL, type = 1, dist = NULL, dump = 0)
}
\arguments{
\item{pref}{string vector containing prefecture names}

\item{type}{= 1 to use 8 districs
= 2 to use 14 districts}

\item{dist}{Not Yet Available}

\item{dump}{= 1 to return the prefecture-district table}
}
\value{
a string vector of the same length as pref containing district names
\cr
or, when dump=1, a table of prefecturesn and the corresponding districts.
}
\description{
Convert Japanese Prefecture to District
}
\examples{

# string vector containing prefecture names
Prefectures <- pref2dist(dump=1)$pref

# prefecture name to prefecture number
PrefecturesNo <- 1:47
names(PrefecturesNo) <- Prefectures
pn <- PrefecturesNo[Prefectures[c(13,26)]]

# prefecture name to district
d1 <- pref2dist( Prefectures )
d2 <- pref2dist( Prefectures, type=2 )
pn <- PrefecturesNo[Prefectures]
printm( pn, Prefectures, d1, d2 )

# invalid prefecture names
pref <- c(Prefectures[13],"Iowa", Prefectures[26])
pref2dist( pref, type=1 )
pref2dist( pref, type=2 )

}
