Basically, I have the following say:
counter <- 3
k <- 9999
I would like to get R to print the following:
on the 3rd count: 9999
Does anyone what command should I use to do this? Please spell it out for me ,as I am completely new to R.
rstatistics
Basically, I have the following say:
counter <- 3
k <- 9999
I would like to get R to print the following:
on the 3rd count: 9999
Does anyone what command should I use to do this? Please spell it out for me ,as I am completely new to R.
Best Answer
The basic construction is
You'll have to be a little clever to choose the right suffix for the digit (i.e. "rd" after 3, "th" after 4-9, etc. Here's a function to do it:
}
Thus:
You need to set the
sep
argument because by defaultpaste
inserts a blank space in between strings.