![](/img/trans.png)
[英]r shiny rhandsontable: create empty table for copy & paste of data
[英]How do I handle an empty table with rhandsontable in Shiny?
當刪除rhandsondtable中的最后一行時,出現以下錯誤:
Warning: Error in matrix: 'data' must be of a vector type, was 'NULL'
Stack trace (innermost first):
61: matrix
60: <Anonymous>
59: do.call
58: hot_to_r
57: observerFunc [#64]
2: runApp
1: editTable [#126]
當我運行此博客文章中的代碼時,也會發生同樣的事情。 我正在使用此代碼進行實驗。
我希望能夠防止這種情況。 我願意接受不同的選擇,例如
我嘗試使用minSpareRows
選項,但這會導致以下錯誤
Warning: Error in row.names<-.data.frame: invalid 'row.names' length
Stack trace (innermost first):
63: row.names<-.data.frame
62: row.names<-
61: rownames<-
60: <Anonymous>
59: do.call
58: hot_to_r
57: observerFunc [#64]
2: runApp
1: editTable [#127]
我現在不熱衷於檢查input$hot
是否包含行,並且由於hot_to_r
函數失敗了,因此我無法使用數據框來執行此操作。
任何有關如何處理“空”表問題的幫助將不勝感激。
input$hot
是一個包含三個項目的列表,第一個項目input$hot$data
包含表數據。 因此,您可以檢查length(input$hot$data)
以確定剩余多少行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.