I am very surprised as I checked the source code for stats::cor function and there is no condition for "spearman" method whereas it is valid under doc
stats::cor