Tuesday, June 11, 2013

Determine Column Number based on Column Names

    # print the column name
    print ( colnam )

    # print the number of columns, this is not changing
    print ( counter <-length(rsm) )

    # determine the column number based on the column name
    # and store to a variable
    columnNumber <- which( colnames(rsm)==colnam )

    # print the column number
    print ( columnNumber )

No comments:

Post a Comment