Displaying 1 result from an estimated 1 matches for "cnm2".
Did you mean:
cnm
2003 Jun 25
3
joining columns as in a relational database
..."School", which = "Sector")
as examples
Several questions:
- Am I duplicating existing functionality?
- Is cjoin a good name for such a function?
- Would this be useful in base?
-------------- next part --------------
"cjoin" <-
function(fr1, fr2, cnm1, cnm2 = cnm1, which)
{
val = as.data.frame(fr1)
vnms = names(val)
cnm1 = as.character(cnm1)
if (length(cnm1) < 1 || any(is.na(match(cnm1, vnms)))) {
stop("cnm1 must be one or more column names from fr1")
}
fr2nm = names(fr2)
if (!missing(cnm2)) {
c...