finding c using R