The output of my code is following:
print(c(ax,bx,cx,dx))
>[1] 232.0000 2.0000 0.6578 1.2356
where in all the cases, the first two numbers are integers, and the rest are real. What should I include in the print statement, such that the output is:
>[1] 232 2 0.6578 1.2356
I know this must be very simple, but somehow I could not figure this out. Thanks for your help :)
Thanks to @user2554330, for mentioning using
noquotelike this:Created on 2022-07-24 by the reprex package (v2.0.1)
You could use
as.characterto remove the trailing zeros like this:Created on 2022-07-24 by the reprex package (v2.0.1)