-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f4406f
commit be6d708
Showing
7 changed files
with
4,773 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# This is a Shiny web application. You can run the application by clicking | ||
# the 'Run App' button above. | ||
# | ||
# Find out more about building applications with Shiny here: | ||
# | ||
# http://shiny.rstudio.com/ | ||
# | ||
|
||
library(shiny) | ||
|
||
# Define UI for application that draws a histogram | ||
ui <- fluidPage( | ||
|
||
# Application title | ||
titlePanel("Old Faithful Geyser Data"), | ||
|
||
# Sidebar with a slider input for number of bins | ||
sidebarLayout( | ||
sidebarPanel( | ||
sliderInput("bins", | ||
"Number of bins:", | ||
min = 1, | ||
max = 50, | ||
value = 30) | ||
), | ||
|
||
# Show a plot of the generated distribution | ||
mainPanel( | ||
plotOutput("distPlot") | ||
) | ||
) | ||
) | ||
|
||
# Define server logic required to draw a histogram | ||
server <- function(input, output) { | ||
|
||
output$distPlot <- renderPlot({ | ||
# generate bins based on input$bins from ui.R | ||
x <- faithful[, 2] | ||
bins <- seq(min(x), max(x), length.out = input$bins + 1) | ||
|
||
# draw the histogram with the specified number of bins | ||
hist(x, breaks = bins, col = 'darkgray', border = 'white') | ||
}) | ||
} | ||
|
||
# Run the application | ||
shinyApp(ui = ui, server = server) |
12 changes: 12 additions & 0 deletions
12
DS4B_101_R_Business_Analysis/test/rsconnect/shinyapps.io/andrew-borst/test.dcf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: test | ||
title: test | ||
username: | ||
account: andrew-borst | ||
server: shinyapps.io | ||
hostUrl: https://api.shinyapps.io/v1 | ||
appId: 2551287 | ||
bundleId: 3369851 | ||
url: https://andrew-borst.shinyapps.io/test/ | ||
when: 1594259918.76245 | ||
asMultiple: FALSE | ||
asStatic: FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,10 @@ r_pkgs <- c( | |
) | ||
|
||
install.packages(r_pkgs) | ||
|
||
r_pkgs <- c( | ||
"tidymodels", | ||
"skimr" | ||
) | ||
|
||
install.packages(r_pkgs) |
4,591 changes: 4,591 additions & 0 deletions
4,591
DS4B_102_R_Shiny_Apps_1/03_sales_dashboard_shiny/02_sales_dashboard_shiny.html
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...board_shiny/rsconnect/documents/shiny_tutorial.Rmd/shinyapps.io/andrew-borst/shiny_tu.dcf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: shiny_tu | ||
title: shiny_t | ||
username: | ||
account: andrew-borst | ||
server: shinyapps.io | ||
hostUrl: https://api.shinyapps.io/v1 | ||
appId: 2551299 | ||
bundleId: 3369869 | ||
url: https://andrew-borst.shinyapps.io/shiny_tu/ | ||
when: 1594260364.53781 | ||
asMultiple: FALSE | ||
asStatic: FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
library(tidyverse) | ||
#Defining URL to download csv (100k digits) | ||
url<-"https://www.angio.net/pi/digits/100000.txt" | ||
#reading file | ||
d <- readr::read_file(url) | ||
dlist = list() | ||
j <- 0 | ||
for(i in 0:99999) | ||
{ | ||
if(i>10000) | ||
{ | ||
sc <- str_count(d, as.character(i)) | ||
if(sc > 5) | ||
{ | ||
j <- j + 1 | ||
z <- cbind.data.frame(x = sc, y = i) | ||
dlist[[j]] <- z | ||
} | ||
} | ||
|
||
} | ||
|
||
big_data = do.call(rbind, dlist) | ||
|
||
#splitting string into single characters | ||
data.vec<-strsplit(data.raw, "") | ||
|
||
|
||
#vector to dataframe and | ||
data.df1<-data.frame(data.vec[1]) | ||
|
||
#removing the "." i.e. 2nd row | ||
data.df2<-data.frame(data.df1[-c(2),]) | ||
|
||
#renaming column to digits | ||
names(data.df2)[1]<-"digits" | ||
|
||
##Dividing the digits into x and y | ||
#Adding a column of row number | ||
data.df3<-data.df2%>% | ||
mutate(id=seq(1:nrow(data.df2))) | ||
|
||
#Adding a column of coordinate (x or y) and reshuffling the columns | ||
data.df4<-data.df3%>% | ||
mutate(cor=ifelse(id%%2==0,"y","x")) | ||
|
||
|
||
#changing class of digits to integers. Earlier parsed as char | ||
|
||
data.df4$digits<-as.integer(data.df4$digits) | ||
|
||
#Creating data frame of x and y coordinates | ||
x<-data.df4[c(T,F),1] | ||
y<-data.df4[c(F,T),1] | ||
|
||
data.cor<-data.frame(x,y) | ||
|
||
head(data.cor) | ||
|
||
#creating a column showing row position | ||
data.cor$pos<-seq(1:nrow(data.cor)) | ||
|
||
#defining the size of each group | ||
lot=1000 | ||
|
||
#Creating groups | ||
data.plot<-data.cor%>% | ||
mutate(grp=floor(pos/lot)+1) | ||
|
||
|
||
#Creating vectors with coordinates of first dot of each group | ||
minx=NULL | ||
miny=NULL | ||
for(i in 0:(49999)){ | ||
j=(floor(i/lot)*lot)+1 | ||
minx[i+1]<-data.plot$x[j] | ||
miny[i+1]<-data.plot$y[j] | ||
} | ||
|
||
#creating columns from vector | ||
data.plot$xend=minx | ||
data.plot$yend=miny | ||
|
||
#Removing rows containing coordinates of first point of each group | ||
|
||
rowrmv<-c(which(data.plot$x==data.plot$xend & data.plot$y==data.plot$yend)) | ||
|
||
data.plotf<-data.plot[-rowrmv,] | ||
|
||
#Plotting | ||
art100k.1<-data.plotf%>% | ||
ggplot()+ | ||
geom_curve(aes(x = x, y = y, xend = xend, yend = yend, colour = factor(x)), | ||
curvature=0.2,alpha=0.2)+theme_void()+ scale_color_brewer(palette="Greys")+ | ||
theme(legend.position = "none",panel.background = element_rect(fill="#000000"))+ | ||
xlim(-1,10)+ylim(-1,10) | ||
|
||
plot(art100k.1) |