run correlation using R on cost and complication