More generic home finding

Reference: https://stat.ethz.ch/pipermail/r-help/2007-March/128217.html