def to_kelvin(value, unit):
    """
    :param value: magnitude in float or int format
    :param unit: units of the input one of C, F, R, or K
    :return: a float value in Kelvin converted from the input unit
    """
    kmap = {
        'C': (lambda c: c + 273.15),
        'F': (lambda f: (f + 459.67) / 1.8),
        'R': (lambda r: r / 1.8),
        'K': (lambda k: k)
    }
    return kmap[unit](float(value))