Displaying 3 results from an estimated 3 matches for "my_dfrm".
Did you mean:
my_df
2017 Jun 01
1
Data import R: some explanatory variables not showing up correctly in summary
...function (s)
{
s <- as.character(s)
s <- sub(pattern = "^[[:blank:]]+", replacement = "", x = s)
s <- sub(pattern = "[[:blank:]]+$", replacement = "", x = s)
s
}
You could restrict it to non-mumeric columns with:
my_dfrm[ !sapply(my_dfrm, is.numeric) ] <- lapply( my_dfrm[ !sapply(my_dfrm, is.numeric) ], trim)
It would have the side-effect, (desirable in my opinion but opinions do vary on this matter), of converting any factor columns to character-class.
>
> Bill Dunlap
> TIBCO Software
> wdunlap...
2017 Jun 01
0
Data import R: some explanatory variables not showing up correctly in summary
Check for leading or trailing spaces in the strings in your data.
dput(dataset) would show them.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Jun 1, 2017 at 8:49 AM, Ulrik Stervbo <ulrik.stervbo at gmail.com>
wrote:
> Hi Tara,
>
> It seems that you categorise and count for each category. Could it be that
> the method you use puts everything that doesn't match the
2017 Jun 01
4
Data import R: some explanatory variables not showing up correctly in summary
Hi Tara,
It seems that you categorise and count for each category. Could it be that
the method you use puts everything that doesn't match the predefined
categories in Other?
I'm only guessing because without a minimal reproducible example it's
difficult to do anything else.
Best wishes
Ulrik
Rui Barradas <ruipbarradas at sapo.pt> schrieb am Do., 1. Juni 2017, 17:30:
>