To use SetPartitionToRGF, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
If the optional argument set is not specified, then it is assumed that Mathematica knows the underlying order on the set for which sp is a set partition.