Quantcast
Channel: User Batanichek - Stack Overflow
Browsing latest articles
Browse All 40 View Live

Comment by Batanichek on R - SQLDF issue with special characters

You need to create reproduceble error ( small data.frame with such error) to alow anyone copy paste and test

View Article



Comment by Batanichek on converting data frame to matrix, sapply is returning...

You can use as.matrix(mymatrix) or if you have only 1 row use it as vector mymatrix<-sapply(unlist(DF), function(x) abs(x - unlist(DF)))

View Article

Comment by Batanichek on Reading eventreactive input from inputtextarea in...

try to use (strsplit(x =input$txt,split = '[\r\n]' )) - to split string into vector.. paste not evaluate you code of 'c(...)' it create simply strung of text

View Article

Comment by Batanichek on modify S3 Generics with dots using formals

I dont know, may be some one have better idea and post it as answer

View Article

Comment by Batanichek on Plot two graphs using plotly package in same plot in R

what means in the same window? in one plot? or in two div in screen? add code of you UI

View Article


Comment by Batanichek on Loading data files with ShinyFiles

@mohammad if you want file from client pc , you can usr fileinput shiny.rstudio.com/reference/shiny/latest/fileInput.html

View Article

Comment by Batanichek on RShiny SQL dataframe to table

And dont forget to disconect after get data or after session end.

View Article

Comment by Batanichek on Shiny: Dynamically Generate Data.Tree

see my example, its what you want? stackoverflow.com/a/39703410/5018792

View Article


Comment by Batanichek on Change text color of geom_text

@Henrik great thanks.

View Article


Comment by Batanichek on How to dynamically rename multiple columns in R...

@MSD Is my second example what you want? or something else?

View Article

Comment by Batanichek on How to change the background color of the Shiny...

Possible duplicate of How to change color in shiny dashboard?

View Article

Comment by Batanichek on How to convert integer to factor?

@M-- with df in example work without NAs , can you provide example with NAs?

View Article

Answer by Batanichek for Shinydashboard remove extra space when header is...

You can add class and then remove it from server side(idea of hide head get here )library(shiny)library(shinyjs)library(shinydashboard)server=shinyServer( function(input, output,session) {...

View Article


Answer by Batanichek for R Shiny selectedInput inside renderDataTable cells

Why not use standart fucntional of DT (Shiny.bindAll)Example( in console print select of 1-st row)library(shiny)library(DT)mymtcars = mtcarsmymtcars$id = 1:nrow(mtcars)runApp( list(ui = fluidPage(...

View Article

Answer by Batanichek for how to replace a column of a data frame with several...

You can do it in loop like res=lapply(1:ncol(Xm),function(i){mydata[[3]] <- Xm[ , i] # change 3-rd column of mydata om i-th colomn of Xmlm(Y~.,data=mydata)})where res - list of your lm modelsIf you...

View Article


Answer by Batanichek for R shiny - last clicked button id

You can do it by adding JS smthing like $(document).on('click', '.needed', function () { Shiny.onInputChange('last_btn',this.id); });Example ( add class needed to btn if you want to control not all...

View Article

Answer by Batanichek for R shiny - save chosen values in selectInput

you can do it by storing values into reactivevValues values stored onlyfor one sessionlibrary(shinyjs) # needed for hide and showui <- shinyUI(fluidPage( titlePanel("Update Select Inputs"),...

View Article


Answer by Batanichek for Is there a way to make R strings verbatim (not...

You can use scan ( but only in interactive session -- not in source)Like path=scan(what="",allowEscapes=F,nlines=1)C:\test\pathprint(path)And thenCtrl+A++Ctrl+Entergive you resultBut not work in...

View Article

Answer by Batanichek for How to convert matrix elements from 0|1 to 1|0 in R?

You can make sample of n elements (10 in example) and change itm1=as.matrix(m)m1 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0 0 1 1 0 0 0 0 1 0 [2,] 0 0 0 0 1 0 0 0 1 1 [3,] 1 0 0 0 0 0 0...

View Article

Answer by Batanichek for How to sort a dataframe by columns giving column...

dplyr examplelibrary(dplyr)sort_list <- c("z","b")sort_order=c(TRUE,FALSE)dd %>% arrange_(.dots=ifelse(sort_order,paste0("desc(",sort_list,")"),sort_list))

View Article

Image may be NSFW.
Clik here to view.

Answer by Batanichek for R plot random graph with same structure

As default in igraph layout= layout_nicely which recalculated each plot You can try to specify layout as matrix or as function to get coordinates layout Either a function or a numeric matrix. It...

View Article


Image may be NSFW.
Clik here to view.

Remove ticks piechart NVD3

Is there way to remove ticks from pie chart in NVD3 rcharts?Examplep4 <- nPlot(~ cyl, data = mtcars, type = 'pieChart')p4gives meI know that there is p4$chart(showLegend = FALSE) which remove legend...

View Article


shiny selectInput does not react to deselect all elements

How to observe of deselecte all elements of selectInput in shiny?for examplelibrary(shiny)ui=shinyUI(fluidPage( selectInput("select","",choices = c(1,2),multiple = T) ))server=function(input,...

View Article

Answer by Batanichek for Save state of input shiny

Also find other way using insertUI ( shiny version >=14)ui=shinyUI(fluidPage( selectInput("select","",choices = c(1,2),multiple = T), div(id="din_2"))) server=function(input, output,session) {...

View Article

Answer by Batanichek for dbwriteTable incompatible with other schemas

In ROracledbWritetable there is param schemadbWriteTable(conn, name, value, row.names = FALSE, overwrite = FALSE, append = FALSE, ora.number = TRUE, schema = NULL, date = FALSE, ...)schema A...

View Article


Answer by Batanichek for R Shiny: conditionalPanel not working if used...

Problem with compare numeric and character in js You need to use 0 only for numerict results ( actionButton and selectInput in your example)You need such condition input.id1>''&&...

View Article

Answer by Batanichek for keep selected rows when changing dataset in shiny DT...

You can save selected rows only when going to change df likeserver <- function(input, output, session) { dd=reactiveValues(select=NULL) observeEvent(input$dataset,{...

View Article

Answer by Batanichek for Reading eventreactive input from inputtextarea in...

Dont know where problem in your code try it library(shiny)ui=shinyUI(fluidPage(textAreaInput("txt",label = ""),actionButton("go","go"),textOutput("rez") ) )server=function(input,output){...

View Article

Encode quoted-printable email in R

Is there package or function for encode quoted-printable text from email using R?For example Content-Type: text/plain; charset="windows-1251"Content-Transfer-Encoding:...

View Article



Answer by Batanichek for how to randomly exchange a column within a function?

It's really hard to understand what you want to achive"except 9" can't include 1 column twice into lm (without transormation) -collinearity. So you need to change X3 on all columns except already...

View Article

Save state of input shiny

Is there good way to save state( dont reset ) of shinyinput which generated on server side?Exampleui=shinyUI(fluidPage( selectInput("select","",choices = c(1,2),multiple = T), uiOutput("din_ui")...

View Article

Answer by Batanichek for Hiding or showing shiny elements without pressing...

You can try UI:library(shiny)shinyUI(fluidPage( titlePanel("submitButton example"), fluidRow( column(3, wellPanel( sliderInput("n", "N:", min = 10, max = 1000, value = 200, step = 10),...

View Article

Answer by Batanichek for Tree plot displays in R, but not in R-Shiny

plot(org) generate widget of class grViz So you can use renderGrViz to show plot in shiny.Like ( textInput used for example of change name of "parent") library(shiny);...

View Article


Answer by Batanichek for Shiny: Dynamically Generate Data.Tree

As i told here you can add panell to control your tree.For example you have base tree:#create main treevv$org <- Node$new(input$root_name)vv$org$AddChildNode(child =...

View Article

Answer by Batanichek for Different pages in Shiny App

If i undertand you right you can create different lists in you additional files 1) admin.r admin_title="Decison Support System"admin_side=list(sidebarMenu( menuItem("Dashboard", tabName = "dashboard",...

View Article

Answer by Batanichek for Use data.table for shiny inputs and store user...

Try to add column of checked name and then remove column whe render DT library(shiny)library(data.table)library(DT)shinyApp( ui = fluidPage( title = 'Radio buttons in a table',...

View Article


Image may be NSFW.
Clik here to view.

ggplot change color of one bar from stacked bar chart

Is there way to change colors of one bar( x - value) manualy in ggplotdatafor_plot_test=structure(list(name = c("A", "B", "C", "A1", "A2", "A3", "A4", "BI", "A", "B", "C", "A1", "A2", "A3", "A4",...

View Article


Edit author of xlsx

Is there way to edit author of .xlsx file from RStudio using xlsx package?I create simple xlsx workbookdata_1=data.frame(1,1,2)require(xlsx)wb <- createWorkbook() sheet <- createSheet(wb,"TEST")...

View Article

ROracle error ORA-12592 when insert a lot of rows

When i use dbWriteTable for dataframe with millions rows sometimes get ORA-12592 error.With small dataframe - all works fine.Is there way to customize dbWriteTable for commit every X rows? Or other way...

View Article

Answer by Batanichek for Usage of ROracle generates Error in .oci.fetch(res,...

May be you have different TZ (server\client) trydbGetQuery(con,"SELECT SESSIONTIMEZONE,DBTIMEZONE FROM dual")SESSIONTIMEZONE DBTIMEZONE1 +03:00 +04:00if you have different values change...

View Article
Browsing latest articles
Browse All 40 View Live


Latest Images