STHDA forum

ggpubr » [Solved] Text Justification in ggtexttable()

Administrator

rank_admin.png

Avatar

Signed up since: 10/02/2013

Messages: 32

On 08/11/2017 at 08h03
The function ggtexttable() [in ggpubr] R package now supports text justification.

Try this:

Code R :
 
# Text justification
#::::::::::::::::::::::::::::::::::::::::::::::
# Default is "centre" for the body and header, and "right" for the row names. 
# Left justification: hjust=0, x=0.1
# Right justification: hjust=1, x=0.9
library(ggpubr)
ggtexttable(head(iris), rows = NULL,
            theme = ttheme(
              colnames.style = colnames_style(color = "white", fill = "#8cc257"),
              tbody.style = tbody_style(color = "black", fill = c("#e8f3de", "#d3e8bb"), hjust=1, x=0.9)
            )
)
 


Output:

Website    
Answer
You aren't allowed to write in this category
1 User online : 0 Administrator, 0 Moderator, 0 Member and 1 Visitor
User online : No member online