Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bioinfo
datautils
Commits
b303fbf8
Commit
b303fbf8
authored
Jun 01, 2016
by
Holger Brandl
Browse files
better prettyfy for column names
parent
d59974ea
Changes
1
Show whitespace changes
Inline
Side-by-side
R/core_commons.R
View file @
b303fbf8
...
...
@@ -201,7 +201,14 @@ rify_names <- function(df){
df
}
pretty_columns
<-
function
(
df
){
names
(
df
)
<-
names
(
df
)
%>%
str_replace_all
(
c
(
" "
=
"_"
,
"-"
=
"_"
,
"[.]"
=
"_"
))
%>%
tolower
;
df
}
pretty_columns
<-
function
(
df
){
names
(
df
)
<-
names
(
df
)
%>%
str_replace_all
(
"[#=.()-]+"
,
"_"
)
%>%
str_replace
(
"[_]+$"
,
""
)
%>%
str_replace
(
"^[_]+"
,
""
)
%>%
tolower
;
df
}
head_html
<-
function
(
df
,
n
=
5
)
head
(
df
,
n
)
%>%
knitr
::
kable
(
format
=
"html"
)
%>%
print
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment