-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.R
More file actions
24 lines (20 loc) · 791 Bytes
/
Copy pathserver.R
File metadata and controls
24 lines (20 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
library(shiny)
library(spatstat)
data(shapley)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
# create a plot of the locations of the galaxies
# in the shapley supercluster
# allow user to select a subset of galaxies to display
output$galaxyPlot <- renderPlot({
allx = shapley$x # x positions of all of the galaxies
ally = shapley$y # y positions of all of the galaxies
# plot the map with all of the galaxies in gray
plot(shapley$x,shapley$y,pch=16,col="gray")
plot(shapley$window,add=T)
# add the subset of galaxies from the slider input
inds = shapley$marks$V >= input$velrange[1] &
shapley$marks$V <= input$velrange[2]
points(shapley$x[inds],shapley$y[inds],pch="+")
})
})