I am working on translating a SAS code to R and since I am new to SAS I am having some trouble understanding data formats in SAS. Also, I don't have access to SAS so i can't try it on a sample data.
My code snippet says -
Data A;
Set A;
format Sales_change percent7.4 sales_units comma10.3;
run;
I believe comma10.3 makes the values 'numeric' like the numeric format in excel. i.e. 1000000 becomes 1,000,000. But what does percent7.4 format do? Does it make 0.2364212 as 23.6421% ? If so, I have been using the following line in R -
A$Sales_change <- percent(A$Sales_change/1)
But this rounds of the numbers to 2 decimal places before reporting the percent values. Can someone tell me if my understanding is right and if right, how to do this in R?