0

I have a simple problem of trying to produce an HTML file with rmarkdown. I want to include a table which has one column which has a long list of genes. All I want to do is set the column width of each column, both columns will require wrapping.

I have gone with pander and it seems to be working when called in R, but when I create the HTML only the first row is included in the table.

pander(df, split.cells = c(30,70), split.table = Inf)

Below is the HTML output any ideas what is happening? enter image description here

dput(df)
structure(c("Cell Cycle, Mitotic", "Cell Cycle", "Adaptive Immune System", 
"Mitotic G1-G1/S phases", "Cytokine Signaling in Immune system", 
"G1/S Transition", "DNA Replication", "G2/M Checkpoints", "Activation of ATR in response to replication stress", 
"S Phase", "CDKN2A, SKP2, CCNE1, NCAPD2, LPIN1, MCM10, TFDP1, NUP155, MCM3, E2F3, OPTN, RFC4, NUP160, CENPN, TFDP2, CCNA1, NUP153, PSMB10, PRKCA, CKAP5, KIF2C, PSME4, GINS4, FOXM1, SEC13, RB1, MCM4, MCM5, CCNA2, PSMB9, RFC3, NCAPG2, CDC7, MCM7, NUP205, CENPA, PRKCB, BIRC5, SMC2, BUB1, CDCA8, PRIM2, NDC80, CDKN2C, PLK1, PPP1CB, CETN2, CEP57, NUP50, PSME1, CCNE2, PSMB8, NCAPH2, VRK1, CDC20, PCM1, MCM2, E2F5, TUBA4A, PSMB2, CDT1, SMC4, ORC1, CUL1, AURKB, PSMD2, CDC25B, KIF18A, UBE2D1, RFC2, TUBG2, SMC1A, PSMB4, NCAPD3, BTRC, CDK6, DNA2, NUP93, POLD1, SPDL1, RBL1, CENPI, PCNA, MCM6, NUP62, POLE2, SKA1, CLASP2, ARPP19, CKS1B, AKAP9, PSMC2, WAPL, BORA, DBF4, CENPF, PLK4, NEK2, SKP1, ORC6, NUMA1, PAFAH1B1, TYMS, KIF23, ZWILCH, FBXO5, FEN1, PSMF1, RRM2", 
"CDKN2A, SFN, SKP2, CCNE1, NCAPD2, LPIN1, MCM10, TFDP1, NUP155, CHEK1, MCM3, E2F3, OPTN, RFC4, NUP160, CENPN, TFDP2, CCNA1, STAG3, NUP153, PSMB10, PRKCA, CKAP5, KIF2C, PSME4, GINS4, FOXM1, SEC13, RB1, MCM4, MCM5, CCNA2, PSMB9, RFC3, NCAPG2, CDC7, MCM7, NUP205, CENPA, HSPA2, PRKCB, BIRC5, SMC2, BUB1, CDCA8, PRIM2, NDC80, CDKN2C, PLK1, PPP1CB, CETN2, CEP57, NUP50, PSME1, CCNE2, PSMB8, MLH1, NCAPH2, VRK1, CDC20, PCM1, MCM2, E2F5, TUBA4A, MRE11A, PSMB2, CDT1, SMC4, ORC1, CUL1, AURKB, PSMD2, CHEK2, CDC25B, KIF18A, UBE2D1, RFC2, TUBG2, SMC1A, HJURP, PSMB4, NCAPD3, HUS1, BTRC, BLM, YWHAB, CDK6, DNA2, NUP93, POLD1, SPDL1, RBL1, CENPI, YWHAQ, PCNA, MCM6, RAD1, NUP62, BRCA2, POLE2, SKA1, CLASP2, ARPP19, CKS1B, AKAP9, PSMC2, WAPL, SUN2, BORA, DBF4, CENPF, PLK4, NEK2, SKP1, ORC6, NUMA1, PAFAH1B1, TYMS, KIF23, ZWILCH, FBXO5, FEN1, MIS18A, PSMF1, RRM2", 
"CTSV, HLA-DOB, PLCG2, NCK1, DYNC1I1, ERBB4, TAP1, LYN, TAP2, ICAM1, RAC1, CYBB, ICOS, CD19, NFKBIE, PSMB10, SOS1, YES1, SELL, KIF2C, AGO1, ITPR1, ITK, PSME4, CD247, SEC13, INPP5D, CD79A, PIK3CD, RIPK2, HLA-F, PSMB9, CD8B, CD96, CTSS, LCK, NCF4, FYB, RASGRP2, PRKCB, ZAP70, PTPRC, TRAT1, LILRB2, PVR, ITPR3, CD8A, CD40, PRKCQ, CD3D, RASGRP3, LCP2, KLRD1, ITGB5, CRTAM, MALT1, CD79B, PSME1, BTK, PSMB8, VAV1, PDGFRA, PSMB2, PAK3, NRAS, CUL1, HLA-DMB, AP1M2, PSMD2, KIF18A, SYK, VCAM1, CD28, NCF2, CD86, CD3E, CD3G, EGFR, FGFR3, PSMB4, LILRB1, BTRC, YWHAB, CD4, KIF3C, PAK2, SEC24B, IKBKB, NPEPPS, RAPGEF3, ICAM2, ICOSLG, ITGB7, DCTN4, PSMC2, KIF3A, RAPGEF4, CSK, CTLA4, FYN, SKP1, ERBB3, KIF23, NFKBIB, ITGB2, FCGR1B, PSMF1", 
"CDKN2A, SKP2, CCNE1, MCM10, TFDP1, MCM3, E2F3, TFDP2, CCNA1, PSMB10, RB1, MCM4, MCM5, PSMB9, CDC7, MCM7, PRIM2, CDKN2C, PSME1, CCNE2, PSMB8, MCM2, E2F5, PSMB2, CDT1, ORC1, CUL1, PSMD2, PSMB4, CDK6, RBL1, PCNA, MCM6, POLE2, CKS1B, PSMC2, DBF4, SKP1, ORC6, TYMS, FBXO5, PSMF1, RRM2", 
"IRAK1, IL1R2, IL6ST, NUP155, IFNG, IRF1, CSF2RB, LYN, ICAM1, IRF8, MAP2K4, NUP160, ADAM17, SOCS2, IRF4, SOCS1, NUP153, SOS1, IL2RG, PTPN2, INPP5D, PIK3CD, IL1RAP, RIPK2, GBP1, HLA-F, TRIM38, PML, NUP205, IFNGR1, CIITA, MYD88, HERC5, MID1, ISG20, IFNAR2, IL7, NUP50, PSMB8, CASP1, CSF2RA, VAV1, CAMK2B, GBP2, KPNA4, NRAS, STAT1, CUL1, SYK, PRLR, IL2RB, VCAM1, IL7R, USP18, CISH, MX2, IL2RA, IL6R, BTRC, YWHAB, LGALS9, NUP93, PTAFR, KPNA3, MAPK1, IKBKB, RSAD2, NUP62, OASL, EIF4E2, SAMHD1, TRIM8, KPNA5, FYN, SKP1, FCGR1B", 
"SKP2, CCNE1, MCM10, TFDP1, MCM3, CCNA1, PSMB10, RB1, MCM4, MCM5, PSMB9, CDC7, MCM7, PRIM2, PSME1, CCNE2, PSMB8, MCM2, PSMB2, CDT1, ORC1, CUL1, PSMD2, PSMB4, PCNA, MCM6, POLE2, CKS1B, PSMC2, DBF4, SKP1, ORC6, TYMS, FBXO5, PSMF1, RRM2", 
"MCM10, MCM3, RFC4, PSMB10, PSME4, GINS4, RB1, MCM4, MCM5, PSMB9, RFC3, CDC7, MCM7, PRIM2, PSME1, PSMB8, MCM2, PSMB2, CDT1, ORC1, PSMD2, RFC2, PSMB4, DNA2, POLD1, PCNA, MCM6, POLE2, PSMC2, DBF4, ORC6, FEN1, PSMF1", 
"SFN, MCM10, CHEK1, MCM3, RFC4, MCM4, MCM5, RFC3, CDC7, MCM7, MCM2, ORC1, CHEK2, RFC2, HUS1, YWHAB, YWHAQ, MCM6, RAD1, DBF4, ORC6", 
"MCM10, CHEK1, MCM3, RFC4, MCM4, MCM5, RFC3, CDC7, MCM7, MCM2, ORC1, RFC2, HUS1, MCM6, RAD1, DBF4, ORC6", 
"SKP2, MCM3, RFC4, PSMB10, PSME4, GINS4, RB1, MCM4, MCM5, PSMB9, RFC3, MCM7, PRIM2, PSME1, PSMB8, MCM2, PSMB2, CDT1, ORC1, CUL1, PSMD2, RFC2, SMC1A, PSMB4, DNA2, POLD1, PCNA, MCM6, POLE2, CKS1B, PSMC2, WAPL, SKP1, ORC6, FEN1, PSMF1"
), .Dim = c(10L, 2L), .Dimnames = list(c("1", "2", "3", "4", 
"5", "6", "7", "8", "9", "10"), c("Pathway", "GeneID")))

view of R console showing splitting working. enter image description here

George
  • 903
  • 8
  • 22
  • `dput()` some example data please. – Martin Schmelzer Sep 01 '16 at 08:40
  • I avoided dput() due the length of the strings, but will edit it for you now – George Sep 01 '16 at 21:18
  • I can't reproduce your problem. Using your data and the line of code provided, I get the full data nicely formatted inside the table. I checked the result with Firefox and Chrome. What do you mean by "working in R"? Do you mean the RStudio viewer? – Martin Schmelzer Sep 01 '16 at 22:09
  • In the R console I'll attach a screen shot. – George Sep 01 '16 at 23:36
  • Working now! Not sure why, might be some code chunk options I was using or the HTML language I had in the text but I moved the code chunk and it now works. – George Sep 01 '16 at 23:53

0 Answers0