Мне нужно реплицировать базовую функциональность View (), как описано ниже, но в блестящей таблице данных (DT :: renderDataTable)
У меня есть таблица, и у нескольких столбцов внутри них очень длинный текст, я быподобно тому, как каждая строка отображается в одну строку, ширина столбца является разумной, поэтому для длинных текстовых столбцов данные переносятся и полностью видны только при наведении на них курсора, например, функция View () отображает фреймы данных.
Найдитеминимальный пример ниже.
library(shiny)
library(DT)
df <- data.frame(A = 1:4, B = T, C = c("Healthcare company",
"tech company",
"develops, manufactures, and distributes antennas, system components, and repeater/rebroadcast systems to wireless communications and renewable energy markets in Australia and internationally. The company offers communications solutions, such as antennas, multicoupling and frequency translating repeater systems, lightning protection products, cables and connectors, batteries, industrial solar products, radio frequency power amplifiers and distribution equipment, and antenna site monitoring solutions for defense, LMR, public safety, and cellular applications in telecommunications, government, and public and private radio operator markets; and cellular distributed antenna systems, tunnel radio rebroadcast systems, and DAS to carriers and building contractors in shopping centers, multi-story office buildings and hospitals. It also engages in the wholesale distribution of solar power products, including stand alone or grid interactive systems and components, including modules, inverters, batteries, and balance of systems hardware; and renewable energy products, such as stand-alone remote area power, industrial, and grid-connect systems in Australia, as well as represents companies in DC and AC power markets. In addition, the company offers installation, consulting, and integrated system services; and site interference and remediation assistance services for large OEMs and integrator customers. It serves emergency service, industrial data collection, building service, and renewable energy providers through a network of resellers, systems integrators, and retail outlets; and a dealer network in the Australian renewable energy market",
"CPG company"),
D = c(1980, 1995, 2015, 2010))
#--------------------
ui <- fluidPage(
dataTableOutput("example_df")
)
server <- function(input, output) {
output$example_df <- renderDataTable({df})
}
shinyApp(ui, server)
Когда я запускаю блестящее приложение, строка таблицы данных, включающая длинные тексты, занимает много места и делает ее бесполезной для визуализации данных
ссылок перед сравнением. Просмотр() против dataTableOutput (), проблема в том, что мне нужно такое поведение, но в блестящем приложении
функция View () ,
функция View (), когдапри наведении курсора мыши на длинные текстовые поля ,
RenderDataTable () обернутый длинный текст