闪亮 - 垂直定位井面板

时间:2017-04-24 19:49:13

标签: r shiny

我正在尝试将一块井板定位在一块也位于井板中的地块的左侧。但是,我现在的代码生成了一个页面,如下图所示。

Page Screenshot

我知道在column命令旁边添加一个偏移量(例如:column(2,offset = 2,...))是wellPanel的水平定位,但是我需要垂直改变wellPanel的位置,这样就没有了t页面上的空白区间。我的示例代码如下。

#Check packages to use in library
{
  library('shiny') #allows for the shiny app to be used
  library('magrittr')
  library('dplyr')
}

#Data

ID_no <- 123
Data_val <- sample(0:100, 25)
employee_name <- as.character("Employee1")
date <- Sys.Date()
ID_1 <-data.frame(ID_no, Data_val, employee_name, date)

ID_no <- 456
Data_val <- sample(0:100, 25)
employee_name <- as.character("Employee2")
date <- Sys.Date()-10
ID_2 <-data.frame(ID_no, Data_val, employee_name, date)

data <-rbind(ID_1, ID_2)
IDchoices <- as.character(unique(data$ID_no))

# UI

ui <- fluidPage(
 fluidRow(
    column(2,
           wellPanel(
             selectInput(inputId = "ID", label="Select ID:", choices = IDchoices, selected = "1", multiple = FALSE, selectize = TRUE)
          )),
   column(10,
          wellPanel(plotOutput("plot1")
          )),
   column(2,
           wellPanel(
             span(h5(strong("Employee:")), h5(textOutput("Staff_name"))),
            span(h5(strong("Date:")),h5(textOutput("Date"))))
   )
 )
)

#SERVER

server <- function(input, output, session)
{

}

#Run the Shiny App to Display Webpage

shinyApp(ui=ui, server=server)

1 个答案:

答案 0 :(得分:2)

你在找这个:

@echo off
setlocal EnableExtensions DisableDelayedExpansion

rem // Define constants here:
set "_ROOT=%~1"  & rem // (use first command line argument as the root directory)
set "_PATTERN=*" & rem // (search pattern for directories; `*` matches all)

set "ERR=0"
rem // Clean up variables beginning with `$`:
for /F "delims==" %%C in ('2^> nul set "$"') do set "%%C="
rem // Enumerate all matching directories recursively:
for /D /R "%_ROOT%" %%D in ("%_PATTERN%") do (
    rem // Store currently iterated directory path:
    set "DIRPATH=%%~D"
    rem // Toggle delayed expansion to avoid trouble with the exclamation mark:
    setlocal EnableDelayedExpansion
    (
        rem /* Capture `wmic` output to query creation date of currently iterated
        rem    directory in locale-dependent and sortable format: */
        for /F "tokens=2 delims==" %%L in ('
            rem/ Do two attempts, because one approach can handle `^)` and one can handle `,`; ^& ^
                rem/ note that `wmic` cannot handle paths containing both of these characters: ^& ^
                2^> nul wmic FSDir where Name^="!DIRPATH:\=\\!" get CreationDate /VALUE ^|^| ^
                2^> nul wmic FSDir where ^(Name^="!DIRPATH:\=\\!"^) get CreationDate /VALUE
        ') do (
            rem // Do nested loop to avoid Unicode conversion artefacts (`wmic` output):
            for /F %%K in ("%%L") do (
                rem /* Assign currently iterated path to variable named of the
                rem    respective creation date preceded by `$`: */
                endlocal & set "$%%K=%%~D"
            )
        )
    ) || (
        endlocal
        rem // This is only executed in case a path contains both `)` and `,`:
        >&2 echo ERROR: Could not handle directory "%%~D"!
        set "ERR=1"
    )
)
rem /* Return all variables beginning with `$` in sorted manner using `set` command,
rem    remember last item of sorted list: */
for /F "tokens=1* delims==" %%C in ('2^> nul set "$"') do set "LASTDIR=%%D"
rem // Return newest directory:
echo "%LASTDIR%"

endlocal
exit /B %ERR%