Hi all,
I have built a Random Forest using Caret package, however, I don't understand
how the splits are labeled in trees. My dataset contains the frequency of the
words in the speeches of the people:
'data.frame': 499 obs. of 608 variables:
$ alright : num 1 0 0 0 0 0 0 1 2 1 ...
$ bad :
Dear R-er,
I would like format integer number as characters with leading 0 for a
fixed width, for example:
1 shoud be "01"
2 shoud be "02"
20 should be "20"
Now I use:
x <- c(1, 2, 20)
gsub(" ", "0", format(x, width=2))
But I suspect more elegant way could be done directly with format
Marc Girondot via R-help writes:
> I would like format integer number as characters with leading 0 for a
> fixed width, for example:
>
> 1 shoud be "01"
> 2 shoud be "02"
> 20 should be "20"
formatC(x, width=2, flag="0")
signature.asc
Description: PGP signature
On Thu, Jan 04, 2018 at 09:12:12PM +0100, Marc Girondot via R-help wrote:
> Dear R-er,
>
> I would like format integer number as characters with leading 0 for a
> fixed width, for example:
>
> 1 shoud be "01"
> 2 shoud be "02"
> 20 should be "20"
>
> Now I use:
>
> x <- c(1, 2, 20)
>
>
Dear R-er,
I would like format integer number as characters with leading 0 for a
fixed width, for example:
1 shoud be "01"
2 shoud be "02"
20 should be "20"
Now I use:
x <- c(1, 2, 20)
gsub(" ", "0", format(x, width=2))
But I suspect more elegant way could be done directly with format
Just a couple of minor comments:
> help.search('read_delim')
No vignettes or demos or help files found with alias or concept or
title matching 'read_delim' using regular expression matching.
read_delim is not part of base R; it must come from some unnamed non-base
package. I'd recommend using
6 matches
Mail list logo