(Please ignore this step if you have already copied the license.dat file. Library(shiny) library(bslib) library(dplyr) library(ggplot2) library(ggExtra) penguins_csv select( where(is.numeric), -Year) ui filter(Species %in% input $species) }) output $scatter <- renderPlot( shinyApp(ui, server)įrom pathlib import Path import pandas as pd import seaborn as sns from shiny import App, Inputs, Outputs, Session, reactive, render, req, ui sns.set_theme() # df = pd.read_csv(Path( _file_).parent / "penguins.csv", na_values = "NA") numeric_cols = df.select_dtypes(include =).columns.tolist() species = df.unique().tolist() species.sort() app_ui = ui.page_sidebar( ui.sidebar( ui.input_selectize( "xvar", "X variable", numeric_cols, selected = "Bill Length (mm)" ), ui.input_selectize( "yvar", "Y variable", numeric_cols, selected = "Bill Depth (mm)" ), ui.input_checkbox_group( "species", "Filter by species", species, selected =species ), ui.hr(), ui.input_switch( "by_species", "Show species", value = True), ui.input_switch( "show_margins", "Show marginal plots", value = True), ), ui.card( ui.output_plot( "scatter"), ), ) def server( input: Inputs, output: Outputs, session: Session): def filtered_df() -> pd.DataFrame: """Returns a Pandas data frame that includes only the desired rows""" # This calculation "req"uires that at least one species is selected req( len( input.species()) > 0) # Filter the rows so we only include the desired species return df.isin( input.species())] def scatter(): """Generates a plot for Shiny to display to the user""" # The plotting function to use depends on whether margins are desired plotfunc = sns.jointplot if input.show_margins() else sns.scatterplot plotfunc( data =filtered_df(), x = input.xvar(), y = input.yvar(), hue = "Species" if input. Click here for downloading the license file, extract the file ‘license.rar’ to get the ‘license.dat’ file. The licenseinfo.xml file is used for Individual licenses with Login Named User enabled. When you install the license manager, the installer performs the following processing of this License File: Makes a copy of your License File, naming it license.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |