天道酬勤,学无止境

reactive

Shiny assign reactive variable from input using loop

问题 我正在尝试使用循环根据我的输入分配反应变量。 例如,我想在 iris 数据集中选择列(来自输入)。 然后从该列中获取唯一值。 我想在循环中做到这一点。 我发现它适用于我的 'joke' 变量,但不适用于我的 'Group[[paste0('Gcol',i)]]' 变量。 这几天我一直在寻找答案。 提前谢谢你的帮助! library(shiny) data=iris ui <- fluidPage( titlePanel("Old Faithful Geyser Data"), sidebarLayout( sidebarPanel( fluidRow( column(9,wellPanel(lapply(1:5, function(i) { selectizeInput(paste0('GroupVar',i), paste0('Group ',i), choices = sort(colnames(data)), options = list(placeholder = 'Select one', onInitialize = I('function() { this.setValue(""); }'))) }) ))) ), mainPanel( fluidRow(column(6, wellPanel( lapply(1:5, function(i) {

2022-05-17 03:50:21    分类:技术分享    loops   shiny   reactive

Interactive file input and reactive reading in shinyapp

问题 我想制作一个闪亮的应用程序,它集成了选择文件(在选定的文件夹中)的功能(如在 Shiny 应用程序(R)中的交互式目录输入中),然后通过检测其中的更改来反应性地读取它,如 https ://gist.github.com/wch/9652222。 但是,我无法使 reactiveFileReader 函数与反应式文件名(文件夹)一起使用。 它似乎只适用于一个预先确定的文件名。 在这个应用程序中,文件预计会在选择任何文件夹(按钮)后自动选择,前提是它在内部并且具有与子文件夹相同的名称和扩展名 .csv 例如,如果您选择 /home/name/folder,则所选文件应为 /home/name/folder/folder.csv 下面是没有预期功能的代码。 它显示了一个示例文件。 server<- function(input, output, session) { shinyDirChoose(input, 'dir', roots = c(home = path1) ) reacdir <- reactive(input$dir) output$dirtext <- renderPrint(c(path(),current() ) ) path1<-"~" path <- reactive({ home <- normalizePath(path1) file.path

2022-05-16 20:11:37    分类:技术分享    r   shiny   reactive

accessing reactiveValues in a reactiveValuesToList

问题 我不想指定单独的fileInput变量,而是使用reactiveValues来存储上传的 CSV 数据帧,以某种方式操作它们,然后存储它们以供以后访问。 我的设计是通过文件名命名每个数据帧并附加到 reactiveValue rvTL 。 我的问题是, 如何访问我使用reactiveValuesToList(rvTL)创建的列表下的各个数据框? 下一步,如何创建一个selectInput菜单来访问fileInput上传的各个数据帧 为了学习这个概念,我借鉴了 Dean Attali 的答案,并使rvTL与他的values变量相同。 R闪亮:如何在每次按下actionButton而不创建新的反应数据框的情况下更新反应数据框? 我已经阅读了有关reactiveValues的许多示例代码,但仍不完全理解。 大多数示例都在reactiveValuesToList(input) R Shiny 上使用某种变体:在修改选择后保留/保留反应输入的值,我真的没有看到这里的逻辑。 任何帮助/建议将不胜感激! library(shiny) runApp(shinyApp( ui=(fluidPage( titlePanel("amend data frame"), mainPanel( fileInput("file", "Upload file", multiple=T)

2022-05-16 14:27:08    分类:技术分享    r   shiny   reactive

How to find the invalid controls in Angular(v2 onwards) reactive form

I have a reactive form in Angular like below: this.AddCustomerForm = this.formBuilder.group({ Firstname: ['', Validators.required], Lastname: ['', Validators.required], Email: ['', Validators.required, Validators.pattern(this.EMAIL_REGEX)], Picture: [''], Username: ['', Validators.required], Password: ['', Validators.required], Address: ['', Validators.required], Postcode: ['', Validators.required], City: ['', Validators.required], Country: ['', Validators.required] }); createCustomer(currentCustomer: Customer) { if (!this.AddCustomerForm.valid) { //some app logic } } this.AddCustomerForm

2022-05-03 03:26:31    分类:问答    angular   angular-reactive-forms   reactive

Spring-webflux filter to fetch the request body

I need to fetch the entire request body in filter and convert it into String. Below is my code but nothing is getting printed on console. @Component public class WebFilter01 implements WebFilter { @Override public Mono<Void> filter(ServerWebExchange serverWebExchange, WebFilterChain webFilterChain) { Flux<DataBuffer> requestBody = serverWebExchange.getRequest().getBody(); Flux<String> decodedRequest = requestBody.map(databuffer -> { return decodeDataBuffer(databuffer); }); decodedRequest.doOnNext(s -> System.out.print(s)); return webFilterChain.filter(serverWebExchange); } protected String

2022-05-02 23:28:36    分类:问答    spring   filter   nonblocking   spring-webflux   reactive

R Shiny - How to create a barplot that reacts according to the time unit (Week, Month, Year) and aggregates data by time unit

问题 我使用以下变量生成有关疾病的数据框: 日期(疾病日期) 案例(案例数量,默认情况下,案例数量为1) 周(病例周) 月份(发病月份) 年份(发病年份)。 我的用户界面在这里: library(shiny) library(dplyr) library(lubridate) library(ggplot2) library(scales) Disease<-data.frame(Date=seq(as.Date("2015/1/1"), as.Date("2017/1/1"), "days"),Cases=rep(1)) Disease$Week<-as.Date(cut(Disease$Date,breaks="week",start.on.monday = TRUE)) Disease$Month<-as.Date(cut(Disease$Date,breaks="month")) Disease$Year<-as.Date(cut(Disease$Date,breaks="year")) ui <- fluidPage( dateRangeInput("daterange", "Choice the date", start = min(Disease$Date), end = max(Disease$Date), min = min(Disease$Date), max

2022-05-02 20:16:38    分类:技术分享    r   date   shiny   dplyr   reactive

Change sliderbar color with setSliderColor within reactive output

I'm building a shiny app that has a reactive slider that I want the bar color to be red. I'm trying to use the setSliderColor() function from the shinyWidgets package, but it's not working. My assumption is that it isn't picking up on the sliderId because it isn't: library(shiny) library(shinyWidgets) ui <- fluidPage( setSliderColor(c("green"), sliderId = c(1)), sidebarLayout( sidebarPanel( textInput(inputId = "greeting", label = "Say hi!"), actionButton(inputId = "submit", label = "Submit"), uiOutput("num_slider"), ), mainPanel() )) server <- function(input, output) { output$num_slider <-

2022-05-01 19:56:34    分类:问答    r   shiny   reactive-programming   reactive   shinywidgets

Service discovery with spring webflux WebClient

Is it possible to use Ribbon and Eureka service discovery with spring webflux webclient? I tried this code but getting an error during integration test. reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: URI is not absolute: /auth-service/auth-service/validate-manager-client-access @Bean @LoadBalanced public WebClient loadBalancedWebClient() { return WebClient.create(baseURL); } @Override public Mono<Boolean> validateManagerClientAccess(Mono<LoginDTO> loginDTOMono) { return webClient .post() .uri(validateManagerURL) .body(loginDTOMono, LoginDTO.class)

2022-05-01 16:48:15    分类:问答    spring   spring-boot   microservices   spring-cloud-netflix   reactive

Migrate from RACSignal to ReactiveSwift or RAC5

问题 我是 Swift 的新手,这就是为什么我是 Reactive Cocoa v5 或 Reactive Swift 的新手。 以前我将 RACSignal 与 RAC 2.x 一起使用,我喜欢做这样的事情: - (RACSignal *)signalForGET:(NSString *)URLString parameters:(NSDictionary *)parameters { return [RACSignal createSignal:^RACDisposable *(id <RACSubscriber> subscriber) { AFHTTPRequestOperation *op = [self GET:URLString parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { [subscriber sendNext:responseObject]; [subscriber sendCompleted]; } failure:^(AFHTTPRequestOperation *operation, NSError *error) { [subscriber sendError:error]; }]; return [RACDisposable

2022-05-01 15:13:24    分类:技术分享    swift   reactive-cocoa   reactive   racsignal   reactive-swift

How to change slider bar color using setSliderColor on multiple sliders when using renderUI in R Shiny

I have multiple sliders that are reactive upon other data that I want to change the color of. I'm trying to avoid long bouts of CSS code, so I'd like to use shinyWidget's setSliderColor() function is possible. This answer worked when I just had one slider, but now that I have two sliders, it won't work. Here's a reproducible example: library(shiny) library(shinyWidgets) ui <- fluidPage( sidebarLayout( sidebarPanel( textInput(inputId = "greeting", label = "Say hi!"), actionButton(inputId = "submit", label = "Submit"), uiOutput("num_slider"), uiOutput("num_slider2"), ), mainPanel(DT::DTOutput(

2022-05-01 06:48:27    分类:问答    r   shiny   reactive   shinywidgets   renderui