У меня проблема с моим блестящим приложением, когда столбчатые данные, отображаемые из файла CSV, отображаются в строках, а не в столбцах (каждая переменная, кроме заголовка, обрабатывается как столбец, тогда как она должна быть выровнена по строке). Каждый раз, когда я получаю доступ к блестящей странице, появляется следующее сообщение об ошибке: «Предупреждение DataTables: таблица id = DataTables_Table_0 - запрошенный неизвестный параметр« 10 »для строки 10. Для получения дополнительной информации об этой ошибке см. http://datatables.net/tn/4".. Прикрепленное изображение ниже
Одно и то же приложение с точно таким же кодом работает абсолютно нормально в кластере качества и дает сбой в работе. Оба ландшафта абсолютно одинаковы. Посмотрите на два изображения ниже, как данные должныпосмотрите и как оно отображается в данный момент. введите описание изображения здесь
Приложение работает на RHEL 7 с R 3,6
Server.R
shinyServer(function(session,input, output) {
myAnalysisList = reactiveFileReader(1000, NULL, "scheduledAnalyses.csv", readFunc = read.csv, stringsAsFactors = FALSE, encoding = "UTF-8")
observeEvent(input$schedule,{
tryCatch({
adjustedDateRange<-getAdjustedDateRange(input$dateRange[1],input$dateRange[2],type = input$forecastType)
currTime = Sys.time()
print(input$forecastHorizon)
forecastHorizonCorrected = input$forecastHorizon
if(input$forecastType!="Monthly"){
forecastHorizonCorrected = input$forecastHorizonWeekly
}
newRow = data.frame(ScheduledAt = as.character(currTime),
StartDate = as.character(adjustedDateRange$startDate),
EndDate = as.character(adjustedDateRange$endDate),
Linea = input$productLinea,
Series = input$productSeries,
Group = input$productGroup,
StatGroup = input$productStatGroup,
ProductCode = input$productCode,
DemProfile = input$demandProfileSelected,
FType = input$forecastType,
FHorizon = forecastHorizonCorrected,
Status = "Scheduled",
Duration = 0)
msg="Just before writing the Schedule"
write.table(newRow,"scheduledAnalyses.csv",sep = "," ,row.names = FALSE,append = TRUE,col.names = FALSE)
output$scheduleStatus = renderUI({
box(title = "Status : Success",status = "success",width =NULL,solidHeader = TRUE,paste("Process has been scheduled at ",currTime, " ",format(currTime, format = "%Z")))
})
}, error = function(errorMsg){
output$scheduleStatus = renderUI({
box(title = "Status : Error",status = "danger", solidHeader = TRUE ,paste("Unable to schedule the process!\n Error: ",errorMsg$message,msg))
})
})
#myAnalysisList <<- bind_rows(myAnalysisList,newRow)
output$analysesList <- renderDataTable(myAnalysisList())
})
output$analysesList = renderDataTable(myAnalysisList())
# observeEvent(input$forecastHorizon,{
# print(input$forecastHorizon)
# })
UI.R
inp<-read.csv("inp.csv",stringsAsFactors = FALSE)
#-------------------------Loading data from Spark ---------------------------------#
#tbl_cache(sc,"demand_forecast_newcode_monthyr")
#inpPtr<-tbl(sc,"demand_forecast_newcode_duedate") %>% filter(linea == "Linea Differenziali DS271" | linea == "Linea Differenziali Elettronici DSE201" | linea == "Linea Differenziali Puri F200" )
#inp<-collect(inpPtr)
#columnNames<-colnames(inp)
#newNames<-sub("^.*\\.","",columnNames)
#colnames(inp)<-newNames
#View(inp)
inp<- inp[!is.na(inp$due_date), ]
inp<- inp[!is.na(inp$linea), ]
inp<- inp[!is.na(inp$series), ]
inp<- inp[!is.na(inp$groupo), ]
inp<- inp[!is.na(inp$gruppo_stat), ]
inp<- inp[!is.na(inp$productcode), ]
inp$due_date <- as.Date(inp$due_date, origin = "1970-01-01")
inpmod <- inp %>%
mutate(Year = year(due_date),
Month = month(due_date),
MonthlyDate = format(due_date, format= "%Y-%m-01"),
QuarterlyDate = quarter(due_date,with_year = TRUE),
SemesterDate = semester(due_date,with_year = TRUE),
WeekInYear = isoweek(due_date)
)
lineaChoices = c("All",unique(inpmod$linea))
serieChoices = c("All",unique(inpmod$series))
groupChoices = c("All",unique(inpmod$groupo))
statGroupChoices = c("All",unique(inpmod$gruppo_stat))
productCodeChoices = c("All",unique(inpmod$materiale))
# Define UI for application that plots random distributions
shinyUI(dashboardPage(
skin="red",
dashboardHeader(title = "Demand Forecasting, ABB Inc.", titleWidth = 350),
dashboardSidebar(
sidebarMenu(
menuItem( "Forecast", tabName = "forecastTab", icon = icon("line-chart")),
menuItem( "Status", tabName = "statusTab", icon = icon("cogs"))
)
),
dashboardBody(
tabItems(
tabItem( tabName = "forecastTab",
fluidRow(
column( width = 8,
fluidRow(
column( width = 12,
box(title = "Timeline", status = "danger", width = NULL,
dateRangeInput("dateRange","Date Range(MM-YYYY):", format = "MM-yyyy",
startview = "decade", start = "2010-01-01",end = Sys.Date())
#tags$br(),
#textOutput("AdjustedDate")
)
)
),
fluidRow(
column( width =12,
box(title = "Product Hierarchy", status = "danger", width = NULL,
column(width = 6,
selectInput("productLinea","Linea", selectize = TRUE,
choices = lineaChoices, selected = "All"),
tags$br(),
selectInput("productGroup","Group",selectize = TRUE,
choices = statGroupChoices, selected = "All"),
tags$br(),
selectInput("productCode","Product Code",selectize = TRUE,
choices =productCodeChoices, selected = "All")
),
column(width = 6,
selectInput("productSeries","Series",selectize = TRUE,
choices = serieChoices, selected = "All"),
tags$br(),
selectInput("productStatGroup","Statistical Group", selectize = TRUE,
choices = groupChoices, selected = "All")
)
)
)
)
),
column( width = 4,
box( title = "Forecast Parameters", status = "danger", width = NULL,
tags$br(),
selectInput("demandProfileSelected","Demand Profile",
choices = c("Predictable", "Unstable", "All"), selected = "Predictable"),
#tags$h4("Select the required granularity for the forecast"),
tags$br(),
selectInput("forecastType","Forecast Type", choices = c("Monthly","Weekly"),
selected = "Monthly"),
tags$hr(),
tags$br(),
#tags$h4("Select the number of time periods from end date to forecast"),
#tags$br(),
conditionalPanel("input.forecastType=='Monthly'",
sliderInput("forecastHorizon", "Forecast Horizon:", 1, 12, 6)),
conditionalPanel("input.forecastType=='Weekly'",
sliderInput("forecastHorizonWeekly", "Forecast Horizon:", 1, 52, 12))
)
)
),
fluidRow(
column(width = 2,
actionButton("clear"," Clear", class = "btn-lg btn-success",
style='color: white; width:100%; height:70px; font-size:150%;',
icon = icon("refresh"))
),
column(width = 3,
actionButton("schedule"," Schedule & Start", class = "btn-lg",
style='color: white; background-color: #dd4b39; width:100%; height:70px; font-size:150%;',
icon = icon("cogs"))
)
# column(width = 8,
# uiOutput("scheduleStatus")
# )
),
fluidRow(
tags$br(),
column(width = 3),
column( width = 6,
uiOutput("scheduleStatus")
)
)
),
tabItem(tabName = "statusTab",
#p("COmiNg sOoN")
fluidRow(
column(12,
box(title = "Scheduled Forecasts", status = "danger", width = NULL,
dataTableOutput('analysesList')
)
)
)
)
)
)
))