안녕하세요! 책 보며 하나씩 해보고 있습니다. 항상 감사드립니다.
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 |
---|---|---|---|
1054 | 기초적인 질문이지만 .. 여쭤봅니다. [2] | 나현둥 | 2021.12.13 |
1053 | 통계와 관련한 기초적인 질문 드립니다.. [2] | 감사합니다 | 2021.12.10 |
1052 | 메타분석 해석 문의 [2] | 루아로 | 2021.12.07 |
1051 | 초보라 질문드립니다 ㅜ [2] | 쵸쿄쵸쿄 | 2021.12.06 |
1050 | ㅠㅠㅠ 초보 질문입니다 [1] | 만고 | 2021.11.26 |
1049 | 라벨붙이기가 안됩니다 [1] | 찬미맘 | 2021.11.22 |
1048 | moonBook ANOVA 질문드립니다. [1] | 타쿠 | 2021.11.20 |
1047 | 3원 분할표? 에서 모델 만드는법 | 플랫슬립 | 2021.11.20 |
1046 | [회귀분석 초급 질문] [1] | 서빱스 | 2021.11.14 |
1045 | [ANOVA 분석 질문] [1] | 서빱스 | 2021.11.14 |
1044 | 대조군1과 치료군2,3,4 의 PSM 에 관해서 질문있습니다. [4] | yessul | 2021.11.11 |
1043 | 서버접속이 안됩니다. Reload [2] | silkywater | 2021.11.11 |
1042 | 메타분석 실행이 안됩니다. [1] | 애플K | 2021.11.08 |
1041 | pair plot 관련하여 질문드립니다. | ulysses11 | 2021.10.29 |
1040 | 메타분석 결과파일 다운로드 하려면 [1] | mono | 2021.10.23 |
1039 | 기본 baseline character table문의드립니다. [1] | ulysses11 | 2021.10.22 |
1038 | 이 error는 뭐가 문제인 걸까요 [1] | CSJU | 2021.10.19 |
1037 | logistic regression에서 p>0.05인 변수의 OR, p 값... | 브이콘65 | 2021.10.14 |
1036 | R 문제가 도저히 안풀려요.. [1] | 자하연미필 | 2021.10.09 |
1035 | 구조방정식에서 종속변수가 0,1로 코딩된 데이터 사용이 가능한가요? [1] | 순수엄마 | 2021.10.08 |
ztable의 option이 'html'로 되어 있어서 입니다. 다음과 같이 "viewer"로 바꿔주시면 됩니다.
options(ztable.type="viewer")
ztable(out)