Breakpoint Error - Windows10

230 views
Skip to first unread message

Esteban Morales

unread,
Jul 26, 2016, 9:34:47 PM7/26/16
to Shiny - Web Framework for R
Hello,

If I set a breakpoint and run an R Shiny application, I see the following errors:

Error in gregexpr(calltext, singleline, fixed = TRUE) : 
  regular expression is invalid UTF-8


I am running the R Shiny project that is loaded when you create a new R Shiny project. I run the same project in Windows 7, breakpoint on the same line of code, no issues.


The same error is thrown when I add breakpoints on my own R Shiny program. Adding a breakpoint and running the application occasionally crashes R Studio. The debugging is also not behaving as expected.
When I move my entire project to Windows 7 and recreate the same breakpoints, no errors are thrown and debugging behaves as expected.

Thank you,
Esteban


By the way, I really enjoyed the R Shiny talk at this year's R Conference! I gained a lot of valuable information and resources. Thank you so much for that!
Error.png

Joe Cheng

unread,
Jul 27, 2016, 11:12:03 AM7/27/16
to Esteban Morales, Shiny - Web Framework for R, Jonathan McPherson
cc Jonathan

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/aa832e19-e4c2-4789-98c5-eeae9cdef73c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted
Message has been deleted
Message has been deleted

Tim Wilson

unread,
Dec 7, 2016, 3:30:34 PM12/7/16
to Shiny - Web Framework for R


If I set a break point and run an R Shiny application, I see the following errors:


Error in gregexpr(calltext, singleline, fixed = TRUE) :
  regular expression is invalid UTF-8


I am attempting to write my first R Shiny app and am experiencing similar problem to those previously reported. In my case the application doesn't crash but just generates the error.

 This is happening using R Studio under  windows 10 and also under Win XP (identical results). I have slightly modified one of the gallery apps to demonstrate the problem. I have not been able to find any information on this particular problem even after quite a bit of searching and reading docs on debugging with R Studio and Shiny.

Attached are 2 screen dumps of the RStudio IDE showing the app working fine without a debug break point set and the error occurring when running once the break point is set. Below is the code I used to reproduce this error and the session version info from Windows 10.

ui.R
pageWithSidebar(
  headerPanel
('Iris k-means clustering'),
  sidebarPanel
(
    selectInput
('xcol', 'X Variable', names(iris)),
    selectInput
('ycol', 'Y Variable', names(iris),
                selected
=names(iris)[[2]]),
    numericInput
('clusters', 'Cluster count', 3,
                 min
= 1, max = 9)
 
),
  mainPanel
(
    plotOutput
('plot1')
 
)
)



server.R

function(input, output, session) {
 
 
# Combine the selected variables into a new data frame
  selectedData
<- reactive({
    iris
[, c(input$xcol, input$ycol)]
 
})
 
  clusters
<- reactive({
    kmeans
(selectedData(), input$clusters)
 
})
 

  output$plot1
<- renderPlot({
    palette
(c("#E41A1C", "#377EB8", "#4DAF4A", "#984EA3",
             
"#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#999999"))
   
    par
(mar = c(5.1, 4.1, 0, 1))
 
   
# This bit of added code is just to test debugger/break point setting
    numClusters
<- input$clusters
   
print(paste("DEBUG Test", numClusters))
     
    plot
(selectedData(),
         col
= clusters()$cluster,
         pch
= 20, cex = 3)
 
    points
(clusters()$centers, pch = 4, cex = 4, lwd = 4)
   
   
})
 
}




> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252 
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                    
[5] LC_TIME=English_Australia.1252  

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base   

other attached packages:
[1] shiny_0.14.2


[1] R6_2.2.0        htmltools_0.3.5 tools_3.3.2     Rcpp_0.12.8     jsonlite_1.1 
[6] digest_0.6.10   xtable_1.8-2    httpuv_1.3.3    mime_0.5     
>

BreakPoint Not Activated.png
BreakPoint Activated.png

Stéphane Laurent

unread,
Dec 26, 2016, 11:21:11 AM12/26/16
to Shiny - Web Framework for R, djche...@gmail.com, jona...@rstudio.com
Same problem with Windows 7 and RStudio 1.0.44.
No solution ?
Reply all
Reply to author
Forward
0 new messages