News for hackers. Stuff that matters.
Re:Data Analysis and Visualization Using R (2014) by sgt101 on Thursday August 11, 2016 @02:53AM (#12266642)
I love R, but I have two problems with it that I would like suggestions to deal with.

1. Debugging seems way more primitive than in other languages; I get cryptic messages and really struggle to pinpoint what is happening. Debugging in (free) shiny is even harder, the page says connection closed and I have to guess what has happened.

2) Code structure. R is simply fantastic in REPL and/or RStudio mode for digging around in data, but longer programs remind me of COBOL (yes, I have programmed in COBOL) longer programs written by other people remind me of the need to drink alcohol. Creating good code with R is vastly harder than Julia, in Julia the challenge is not to create working clean code - that's natural, the challenge is to create the best code that it's ever possible to have. In R the challenge (for me) is to make it work and not make a plate of spaghetti.

Re:Data Analysis and Visualization Using R (2014) by stewbrew on Thursday August 11, 2016 @03:11AM (#12266690)
Ad 1. See ?browser ?traceback ?debugger. You also have breakpoints.

Ad 2. There are reference classes which also provide limited type checking for fields. You can also encapsule your code in environments which is more R-style but doesn't work well with roxygen.

Re:Data Analysis and Visualization Using R (2014) by blahi on Thursday August 11, 2016 @02:57AM (#12266655)
Sounds like you need some Visual Studio in your life.

And you probably need to be more assertive.

https://cran.r-project.org/web/packages/assertive/index.html

https://www.youtube.com/watch?v=JWjiMvlfCwk

(and you do use testhat for unit testing, right?)

Additionally you want to write more modular code. There is lots of infrastructure around that in R, but people just don't use it often enough because a lot of them aren't programmers.

mlr provides very convenient infrastructure for building data mining pipelines where you can fuse steps with each other.

http://mlr-org.github.io/mlr-tutorial/release/html/

For non-model building activities, i.e. inference or exploratory analysis, mason is a great way to do it.

https://cran.r-project.org/web/packages/mason/vignettes/spec...

Re:Data Analysis and Visualization Using R (2014) by sgt101 on Thursday August 11, 2016 @06:16AM (#12267123)
I use r-studio but not sure what visual studio will bring - will investigate.
Re:Data Analysis and Visualization Using R (2014) by blahi on Thursday August 11, 2016 @06:54AM (#12267230)
Project management and develops tools.
Re:Data Analysis and Visualization Using R (2014) by michaelsbradley on Thursday August 11, 2016 @11:08AM (#12268800)
For (2), you may want to look at a couple of module systems for R:

https://github.com/klmr/modules

https://github.com/wahani/modules

Neither is perfect, but I've found them helpful in my projects. They involve much less overhead than writing packages, especially when the modularization I'm trying to achieve is purely internal to my project and I don't intend to publish the code. At the same time, they provide much better encapsulation compared to `base::source`.

Re:Data Analysis and Visualization Using R (2014) by jcheng on Thursday August 11, 2016 @03:50AM (#12266778)
FYI, debugging in Shiny has gotten much better in 0.13.1 and later (you now get stack traces at the console, or in your log file if running on your own Shiny Server, or in your admin console if running on ShinyApps.io).
Re:Data Analysis and Visualization Using R (2014) by sgt101 on Thursday August 11, 2016 @06:15AM (#12267115)
How? I have looked, but shiny says "debugging is private, talk you your admin".... (I'm running ubuntu on aws)
Re:Data Analysis and Visualization Using R (2014) by jcheng on Thursday August 18, 2016 @02:32AM (#12310752)