안녕하세요! 책 보며 하나씩 해보고 있습니다. 항상 감사드립니다.
table을 보기 좋게 하는 것을 연습하는데까지 왔습니다만..
script에 이렇게 입력하였더니, 최초 한번만 viewer에 표가 깔끔하게 떴습니다.
install.packages("ztable")
library(ztable)
options(ztable.type="html")
out <- mytable(Dx~LDLC+DM, data=acs)
out
ztable(out)
지금은..console에 다음과 같이 뜹니다. 도와주세요. install.packages도 여러번 해봤지만 반복됩니다.
> out
--------------------------------------------------------
Descriptive Statistics by 'Dx'
________________________________________________________
NSTEMI STEMI Unstable Angina p
(N=153) (N=304) (N=400)
--------------------------------------------------------
LDLC 126.1 ± 44.7 116.7 ± 39.5 112.9 ± 40.4 0.004
DM 0.209
- No 96 (62.7%) 208 (68.4%) 249 (62.2%)
- Yes 57 (37.3%) 96 (31.6%) 151 (37.8%)
--------------------------------------------------------
> ztable(out)
<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;">NSTEMI</th>
<th <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: hidden;border-top: 2px solid gray;">STEMI</th>
<th <th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: hidden;border-top: 2px solid gray;">Unstable Angina</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=153)</th>
<th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: 1px solid gray;">(N=304)</th>
<th align="center" style="font-weight: normal;border-left: 0px solid black;border-bottom: 1px solid gray;">(N=400)</th>
</tr>
<tr>
<td align="left" style="border-left: 0px solid black;">LDLC </td>
<td align="left" style="border-left: 0px solid black;">126.1 ± 44.7</td>
<td align="center" style="border-left: 0px solid black;">116.7 ± 39.5</td>
<td align="center" style="border-left: 0px solid black;">112.9 ± 40.4</td>
<td align="right" style="border-left: 0px solid black;border-right:0px solid black;">0.004</td>
</tr>
<tr>
<td align="left" style="border-left: 0px solid black;border-top: hidden;">DM</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="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.209</td>
</tr>
<tr>
<td align="left" style="border-left: 0px solid black;border-top: hidden;"> No </td>
<td align="left" style="border-left: 0px solid black;border-top: hidden;">96 (62.7%)</td>
<td align="center" style="border-left: 0px solid black;border-top: hidden;">208 (68.4%)</td>
<td align="center" style="border-left: 0px solid black;border-top: hidden;">249 (62.2%)</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;"> Yes</td>
<td align="left" style="border-left: 0px solid black;border-top: hidden;">57 (37.3%)</td>
<td align="center" style="border-left: 0px solid black;border-top: hidden;">96 (31.6%)</td>
<td align="center" style="border-left: 0px solid black;border-top: hidden;">151 (37.8%)</td>
<td align="right" style="border-left: 0px solid black;border-right:0px solid black;border-top: hidden;"></td>
</tr>
<tr>
<td colspan="5" align="left" style="font-size:9pt ;border-top: 1px solid black; border-bottom: hidden;"></td>
</tr>
</table>
>
Comment 2
-
cardiomoon
2020.03.22 08:52
-
kiho
2020.03.22 16:52
No. | Subject | Author | Date |
---|---|---|---|
1193 | 첫번째 행을 라벨로 사용 버튼 클릭시 에러 문의 [3] | 수담이 | 2023.05.04 |
1192 | 안녕하세요? web-R table 그리고 관련하여 문의드립니다. [4] | mkw7654 | 2023.05.02 |
1191 | 메타분석 U3 그래프 관련 문의드립니다 | 화이팅 | 2023.05.02 |
1190 | 교수님 안녕하세요~~ | 메시12 | 2023.04.29 |
1189 | 연속형 변수인데 범주형으로 인지됩니다. [2] | shararaku | 2023.04.28 |
1188 | 통계마당 [2] | ejo | 2023.04.27 |
1187 | moonBook 오류 관련 재문의드립니다. [1] | holyhyun | 2023.04.24 |
1186 | moonBook 사용시 오류메시지로 문의드립니다. [1] | holyhyun | 2023.04.24 |
1185 | 에러 문의 [2] | 화이팅 | 2023.04.19 |
1184 | Cox regression 에 대한 문의입니다. [2] | saga | 2023.04.18 |
1183 | PSM 문의 [3] | starwars | 2023.04.13 |
1182 | ggPS, ggPSMSummary function [6] | 로렌쵸메디치 | 2023.04.12 |
1181 | Survival 분석에 대해서 문의 드립니다. | 정훈신 | 2023.04.05 |
1180 | 안녕하세요. 분석 툴에 대해 문의드립니다. [1] | 스매직맨 | 2023.04.04 |
1179 | 드디어 publish 되었네요. [2] | 정지윤 | 2023.04.04 |
1178 | 연구동향분석 시 논문 데이터 정제 관련 [5] | vtlbtl | 2023.03.31 |
1177 | 안녕하세요 교수님 에러 문의드립니다 [2] | 소소 | 2023.03.26 |
1176 | 코딩값이 여러개인 변수에 대한 전체 p값을 알 수 있는 방법이 궁금합니다 | 쥬쥬즈주 | 2023.03.22 |
1175 | PSM 매칭 버튼 보이지 않음. | swpapa | 2023.03.19 |
1174 | group-based trajectory modeling | swpapa | 2023.03.19 |
ztable의 option이 'html'로 되어 있어서 입니다. 다음과 같이 "viewer"로 바꿔주시면 됩니다.
options(ztable.type="viewer")
ztable(out)