質問編集履歴

2

コメント文削除。

2018/11/30 08:09

投稿

Shellykagoshima
Shellykagoshima

スコア17

test CHANGED
File without changes
test CHANGED
@@ -2,17 +2,13 @@
2
2
 
3
3
  以下のように書きましたが、画像が表示されずに困っています。
4
4
 
5
- l
6
-
7
- ibrary(shiny)
5
+ library(shiny)
8
6
 
9
7
 
10
8
 
11
9
  shinyUI(fluidPage(
12
10
 
13
11
 
14
-
15
- # Application title
16
12
 
17
13
  titlePanel("TCF"),
18
14
 
@@ -36,8 +32,6 @@
36
32
 
37
33
 
38
34
 
39
- # main panel
40
-
41
35
  mainPanel(
42
36
 
43
37
  fluidRow(
@@ -58,11 +52,11 @@
58
52
 
59
53
 
60
54
 
55
+
56
+
61
57
  library(shiny)
62
58
 
63
59
 
64
-
65
- # Define server logic required to draw a histogram
66
60
 
67
61
  shinyServer(function(input, output) {
68
62
 

1

コードを修正

2018/11/30 08:09

投稿

Shellykagoshima
Shellykagoshima

スコア17

test CHANGED
File without changes
test CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  以下のように書きましたが、画像が表示されずに困っています。
4
4
 
5
+ l
6
+
5
- library(shiny)
7
+ ibrary(shiny)
6
8
 
7
9
 
8
-
9
- # Define UI for application that draws a histogram
10
10
 
11
11
  shinyUI(fluidPage(
12
12
 
@@ -14,41 +14,45 @@
14
14
 
15
15
  # Application title
16
16
 
17
- titlePanel("Hello Nagoya!"),
17
+ titlePanel("TCF"),
18
18
 
19
19
 
20
20
 
21
- # Sidebar with a slider input for number of bins
21
+
22
22
 
23
- sidebarLayout(
23
+ fluidRow(
24
24
 
25
- sidebarPanel(
25
+ column(2,
26
26
 
27
-
27
+ fileInput("file1", "Choose image File",
28
28
 
29
- #file ipnput
29
+ multiple = TRUE,
30
30
 
31
- fileInput("file", label = h3("File input"),accept = c(".png",".bmp","jpeg"))
31
+ accept = c(".png","bmp","jpeg","jpg"))
32
32
 
33
- ),
33
+ ),
34
34
 
35
+ column(10,
35
36
 
37
+
36
38
 
37
- mainPanel(
39
+ # main panel
38
40
 
39
- #plotOutput("Result")
41
+ mainPanel(
40
42
 
41
- imageOutput("Result")
43
+ fluidRow(
42
44
 
43
-
45
+ column(12,
44
46
 
45
- )
47
+ imageOutput("image"))
46
48
 
47
- )
49
+ )
48
50
 
51
+ ))
49
52
 
53
+ )
50
54
 
51
-
55
+
52
56
 
53
57
  ))
54
58
 
@@ -62,16 +66,16 @@
62
66
 
63
67
  shinyServer(function(input, output) {
64
68
 
69
+
70
+
65
- output$Result <- renderPlot({
71
+ output$image <- renderPlot({
72
+
73
+ req(input$file1)
66
74
 
67
75
 
68
76
 
69
- #req(input$file)
77
+ bmp(input$file1$datapath,width=300,height=300)
70
78
 
71
- img <- img(src=input$file)
79
+ })
72
80
 
73
-
74
-
75
- })
81
+ })
76
-
77
- })