안녕하세요. 감사하게 잘 이용하고 있습니다.
제가 가지고 있는 csv file로 mytable을 적용하려고 책을 보고 하다가..
data에 넣지 못해서 하루를 보내고
web-r에서 code를 보고 다시 해보고 있는데요.
filename <- "my_file.csv"
A<- read.table(filename,header=TRUE,sep=",")#arrange to A
require(moonBook)
require(ztable)
require(dplyr)
res= mytable(location_rcc ~sex+age_dx+pathology_rcc+stage_t+stage_n+stage_m+surgery+name_op+existence_ivc_thrombosis+existence_rvt+metastatsis_lung,data =A,method=1,digits=1,exact=TRUE,catMethod=2,max.ylev = 6)
z=ztable(res)
z <- addSigColor(z)
이렇게 했습니다.
console에서 오류메세지가 없는데 table이 보이지 않아서
뭐가 문제일지 질문드립니다.
감사합니다.
Comment 3
-
cardiomoon
2023.02.19 13:21
-
난둥
2023.02.19 21:55
<head><style> table { font-family: times ; color: black ; text-align: right;} th { padding: 1px 1px 5px 5px; } td { padding: 1px 1px 5px 5px; } </style></head><table align="center" style="border-collapse: collapse; caption-side:top; font-size:11pt;"><caption style="text-align:center;"></caption><tr> <th <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: hidden;border-top: 2px solid gray;"></th> <th <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: hidden;border-top: 2px solid gray;">0</th> <th <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: hidden;border-top: 2px solid gray;">1</th> <th <th rowspan="2" align="center" style="font-weight: normal;border-left: 0px solid black;border-right:0px solid black;border-bottom: 1px solid gray;border-top: 2px solid gray;">p</th> </tr> <tr> <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: 1px solid gray;"></th> <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: 1px solid gray;">(N=11)</th> <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: 1px solid gray;">(N=15)</th> </tr> <tr> <td align="left" style="border-left: 0px solid black;">sex </td> <td align="left" style="border-left: 0px solid black;"></td> <td align="center" style="border-left: 0px solid black;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;">1.000</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">3 (27.3%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">3 (20.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">8 (72.7%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">12 (80.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">age_dx </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">60.6 ± 11.0</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">57.5 ± 8.7</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.431</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">pathology_rcc </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.350</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">10 (90.9%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">14 (93.3%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">1 ( 9.1%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"> 0 ( 0.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 3 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 ( 0.0%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">1 ( 6.7%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">stage_t </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.353</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">2 (18.2%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">1 ( 6.7%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 2 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">1 ( 9.1%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">1 ( 6.7%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 3 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">4 (36.4%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">9 (60.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 4 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">4 (36.4%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">2 (13.3%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 5 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 ( 0.0%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">2 (13.3%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">stage_n </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.746</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">4 (36.4%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">5 (33.3%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">6 (54.5%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">7 (46.7%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 5 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">1 ( 9.1%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">3 (20.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">stage_m </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">1.000</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">3 (27.3%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">3 (20.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">8 (72.7%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">12 (80.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">surgery </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.427</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">7 (63.6%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">6 (40.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">4 (36.4%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">9 (60.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">name_op </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.427</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">4 (36.4%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">9 (60.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 3 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">7 (63.6%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">6 (40.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">existence_ivc_thrombosis</td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">1.000</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 ( 0.0%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"> 0 ( 0.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> ? </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">1 ( 9.1%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"> 0 ( 0.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">10 (90.9%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">12 (80.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 ( 0.0%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">3 (20.0%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">existence_rvt </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.774</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">9 (81.8%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">14 (93.3%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">2 (18.2%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">1 ( 6.7%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;">metastatsis_lung </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="center" style="border-left: 0px solid black;border-top: hidden;"></td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;">0.328</td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 0 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">1 ( 9.1%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">5 (33.3%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td align="left" style="border-left: 0px solid black;border-top: hidden;"> 1 </td> <td align="left" style="border-left: 0px solid black;border-top: hidden;">10 (90.9%)</td> <td align="center" style="border-left: 0px solid black;border-top: hidden;">10 (66.7%)</td> <td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td> </tr> <tr> <td colspan="4" align="left" style="font-size:9pt ;border-top: 1px solid black; border-bottom: hidden;"></td> </tr> </table>
print(z) 을 하니 이렇게 나옵니다.
-
cardiomoon
2023.02.20 09:11
## 아래 명령어는 viewer로 표가 나옵니다.
print(z,type="viewer")
## console로 표가 나옵니다.
res
print(z) 해보셔요