2016-11-03 10 views
0

Shiny에 비상 계획 테이블을 만들 수 없습니다. 그것은 크로스 탭이 아닌 두 개의 컬럼을 나란히 배치합니다.R Shiny-Contingency 테이블

output$currtarget<-renderTable({ 

    currtgt<- cstable %>% 

     select(parent_id,tutor_id,status_name,first_name) #%>% 

     xtabs(as.formula(paste0("~",status_name,"+",first_name),currtgt) 

    }) 

답변

0

오늘 내 패키지를 모두 업데이트 한 후 나에게도 이런 일이 일어났습니다. 지난 주에 문제가 없었습니다. 왜 변경되었는지는 모르지만 매우 성가신!

어쨌든, 제 해결 방법은 as.data.frame.matrix을 사용하고 중괄호와 마지막 괄호 사이에 include.rownames=TRUE을 설정하는 것이 었습니다.

renderTable = ({ 
... 
my_tbl = addmargins(table(one_group, another_group)) 
printed_tbl = as.data.frame.matrix(my_tbl) 
print_tbl 
}, include.rownames=TRUE)