list_to_s4 function

Convert a named list to an S4 object