Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7524993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:12:50+00:00 2026-05-30T03:12:50+00:00

I am generating a lot of ftable() crosstabulations for a descriptive report. Example: AUS

  • 0

I am generating a lot of ftable() crosstabulations for a descriptive report. Example:

              AUS  BEL  BUL  EST  FRA  GEO  GER  HUN  ITA  NET  NOR  ROM  RUS

30- primary    0.06 0.03 0.07 0.03 0.02 0.03 0.03 0.02 0.05 0.03 0.05 0.04 0.02
    secondary  0.30 0.09 0.16 0.10 0.10 0.14 0.10 0.16 0.11 0.08 0.08 0.09 0.11 
    tertiary   0.05 0.07 0.04 0.05 0.07 0.06 0.02 0.04 0.02 0.05 0.06 0.02 0.09
30+ primary    0.07 0.16 0.12 0.07 0.16 0.03 0.05 0.11 0.35 0.21 0.09 0.17 0.03
    secondary  0.40 0.20 0.30 0.29 0.25 0.35 0.35 0.34 0.27 0.20 0.27 0.34 0.26
    tertiary   0.13 0.23 0.13 0.18 0.17 0.17 0.18 0.09 0.09 0.23 0.23 0.06 0.24
60+ primary    0.00 0.12 0.10 0.13 0.14 0.07 0.05 0.12 0.09 0.11 0.06 0.19 0.12
    secondary  0.00 0.05 0.05 0.08 0.06 0.10 0.14 0.09 0.02 0.04 0.11 0.07 0.06
    tertiary   0.00 0.05 0.03 0.06 0.03 0.04 0.07 0.03 0.01 0.05 0.06 0.02 0.07

I am looking for a function that could take the ftable() or table() output, and highligh values that deviate from the row-mean, or assign an overall gradient to the text of the values, e.g. from 0-100% the values are coloured from red to green.

The output is now processed through knitr, but I’m not sure at which point in the toolchain I could intervene and add colour based on the relative size of the values.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:12:52+00:00Added an answer on May 30, 2026 at 3:12 am

    You can use the latex function, in the Hmisc package.

    # Example shamelessly copied from http://www.karlin.mff.cuni.cz/~kulich/vyuka/Rdoc/harrell-R-latex.pdf
    cat('
      \\documentclass{article}
      \\usepackage[table]{xcolor}
      \\begin{document}
      <<results=tex>>=
      library(Hmisc)
      d <- head(iris)
      cellTex <- matrix(rep("", nrow(d) * ncol(d)), nrow=nrow(d))
      cellTex[2,2] <- "cellcolor{red}"
      cellTex[2,3] <- "color{red}"
      cellTex[5,1] <- "rowcolor{yellow}"
      latex(d, file = "", cellTexCmds = cellTex, rowname=NULL)
      @
      \\end{document}',
      file="tmp.Rnw" )
    Sweave("tmp.Rnw")
    library(utils)
    texi2pdf("tmp.tex")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're running continuous integration builds from TFS, and generating a lot of symbol files
I seem to be generating a lot of questions with this one little iPhone
as title, I have having quite a lot of panels when generating a chart
I see a lot of projects in other languages for generating static web sites
I am generating a lot of HTML code via PHP, but I need to
I have noticed that IIS of Azure Web-Roles is generating a lot of logs,
I'm generating iframes dynamically for a lot of different random websites, and I tend
Can someone show me an example of setting canvas terminal and generating output as
I've searched a lot but could not solve this problem. I am generating PDF
I'm new to java, i'm working width android sdk Im generating a lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.