在R闪亮的单选按钮中切换输出

时间:2019-01-31 00:36:23

标签: r shiny

我正在使用ShinyWidgets中的/*Ptr<LineSegmentDetector>*/ cv::Ptr<cv::LineSegmentDetector> ls = cv::createLineSegmentDetector(cv::LSD_REFINE_STD) ;//Creates the line detector (AKA what I called the edge detector) std::vector<cv::Vec4f> lines_std; [image convertToMat: &mat]; // Detect the lines ls->detect(mat, lines_std); //Swift compatible NSMutableArray to return from this method NSMutableArray *edgeLines; printf("currently finding the edge lines"); for (int i = 0; i < lines_std.size(); i ++) { NSMutableArray<NSNumber *> *vector; //Convert from Vec4f to NSNumber for (int k = 0; k < 4; k ++) { [vector addObject: [NSNumber numberWithFloat: (lines_std[i][k])]]; //HERE, I'm parsing each float value in each vector (from std::vector<cv::Vec4f>) and adding it to a NSArray, like a vector } //Here, I add the vectors to the return NSMutable array [edgeLines insertObject:vector atIndex:edgeLines.count]; } return edgeLines; 开发一个闪亮的应用程序。因此,对于每个按钮,我都尝试切换到不同的输出,例如表格或图表。如何将单选按钮链接到输出

def median(L):

    n = len(L)
    if n % 2 == 0:
        x = L[n//2]
        y = L[(n//2)-1]
        median = (x + y)/2

    else:
        median = L[n//2]
    return median

1 个答案:

答案 0 :(得分:1)

在服务器端,您可以像这样访问输入的ID:

         Value = input$Id069

因此,将这样的逻辑添加到服务器端(在output $ plot内):

        If (Value == x) {
          Plot1()
        } else {
          Plot2()
        }

您可能希望查看UI上的条件面板。