How Do You Set The RectTransform Rect Width? C#

Good Afternoon,
I have been trying to set the width of a rect transform component using RectTransform.rect with out success, please find my current code bellow.

RectTransform tfm = gameObject.AddComponent<RectTransform>();

Rect temp = tfm.rect;
float tempX = tfm.rect.width;
tempX = ProportionsModifier.width;
temp.width = tempX;

Thanks

RectTransform.SetSizeWithCurrentAnchors.