Come on... Be honest - What R you not using R for?

I just had to parse a really complicated 20,000 line text file line-by-line, where the parsing primarily was driven by regular expressions, but also hashes having to merge different lines based on certain criteria. I confess - I used perl. I now have a nice tsv-file and downstream will naturally be R :sunglasses:

I have the opposite problem: I have an R-shaped hammer, and everything looks like an R-shaped nail :laughing: A few times I've thought, "I should've just done this with a bash script," or I ought've used Python because my centre had existing tools available in Python. Ahh well :stuck_out_tongue:

3 Likes

I use Bootstrap or Materialize to build webpages something you can't do in R.
I use postgresql or SQL server to store data you can't use R to store data.

Now I am trying to learn golang so that I can make softwares and stuff with computer programming.

Well technically R just doesn't even want to go in programming field. it is all for statistics and nothing for programming. R is more like SAS than C++. It should be called a software not programming language.

:rofl::rofl::rofl::rofl::rofl:

2 Likes

I use Excel (gasp!) for data entry.
I use PostgreSQL for persistent data storage.
I use Power BI for reporting, because that is how corporate world works.
I have a bookeeping suite for accounting and taxes.

1 Like

Not to be mean, but you don’t know what you are talking about. If you are relatively new to R or new to programming, it’s easy to take your position that R is just a statistical software environment, but it’s incorrect. R is an atypical programming language, for certain. It has warts and oddities. It’s also incredibly expressive and elegant for many exercises. If you’ve got the basics of R down, but want to learn more about programming in R, I encourage you to read both of these books:

https://nostarch.com/artofr.htm

http://adv-r.had.co.nz/Introduction.html

Here’s some specifics to counter each of your points about what R is capable of:

You can make webpages in R using rmarkdown, shiny, whiskers, and probably a dozen other packages. Those first two examples use bootstrap for html and css by default, and there is even a materialize package if you want that styling. All from within R.

While R processes data in memory, it’s possbilibe to use .Rdata files to save state of many tables basically representing a database. This probably impractical for very large datasets and/or collaborating with more than a couple other people, especially if you have frequent write access needed. SQL databases are definitely a better option for storing data, but doesn’t mean R can’t.

R is a fully capable programming language. If it wasn’t, there wouldn’t be this wonderful ecosystem of packages to accomplish most any programming task you can think of. R has support for both object oriented and functional programming paradigms. R has an abundance of included, native data structures; some common to other languages like lists and vectors, others only supported through external packages like matrices and time series. R provides an expressive language that enables creation of Domain Specific Languages (DSLs) like ggplot and dplyr that make programming for certain contexts, plotting and data wrangling respectively, much easier. R has functions, closures, and namespaces (environments). Not every programming language is the same, but R is certainly capable of accomplishing many generic programming tasks.

Now for me... what do I choose not to do in R?

I choose not to write new libraries for APIs that don’t exist in R, but are well done in python. I’d rather just use the work of someone else to reduce my workload. I have written API wrappers before when the python equivalents were poorly done or were missing critical components that I needed. I used the httr and jsonlite packages to do so. I don’t write MVC applications in R. I’d probably choose Django in python or Rails in ruby if I wanted to do something like that. I have built simple REST API services using the R packages plumber and Rserve. I really like plumber, but it makes me want to use flask or quartz in python instead for the plugin ecosystem (flask) or asynchronous performance (quartz).

I hope anyone who read this far got something out of my rant.

15 Likes

Calm down buddy

this is the only language I know of. I know no other language and use none other than this. So I am a huge fan.

I love R

but my points are valid I would again point out

  1. name a webpage which was written in R (shiny or Markdown).
  2. name a database which was written in R( DB have been written in go, c, java and python not in R)

R is excellent in it's domain and I love it for that but when you try to force it out of the box it breaks and create huge problems.

Entire R team is trying to rebuild the wheel again and again.

like there is team working on data.table and one on dplyr
one working on matter and other on FF
one working on plotly other on hcharts and so on and so forth...

it's like you can do one thing in thousand ways. shouldn't it be thousand things in a single way.

at last we are both on the same boat I want you and everyone aboard to succeed and help each other out. But we can't deny basic facts.

:grin::grin::grin::grin:

Not trying to bash you here, but @raybuhr is completely right about the status of R as a programming language. It meets every definition and should not be diminished.

There are a large number of (basic) web pages written using Rmarkdown (not that this has anything to do with R being a programming language or not). Many prominent R bloggers do so and this is only a relatively recent innovation.

There is no reason to write a db in R, but it sure can intergface with them extremely well, so much so that Oracle, MS and others have added R into their enterprise db products.

You then refer to the package ecosystem, which is organic and chaotic, but has produced a wonderful set of additional functionality, all thanks to R as a programming language.
.

5 Likes

@martin.R and @raybuhr

I think I come out here as a bad guy. I was just trying to answer the question. I have many R programmer in my team but they use R only for statistics and if they have to build anything they move to JS, python or golang etc...

This is all I knew and All I know. I think I need to explore R more deeply. But if you visit RStudio.com webinars you will see like all of them related to data and science.

I am sorry if It came out as wrong. I thought these are weaknesses but as you pointed out I think I have to learn more R to overcome it.

I actually love R ,I am a pretty active member of the group and I use it like 80% of the time.

thanks for pointing out advanced R i will surely go through it.

:hugs::hugs::hugs::hugs::hugs:

1 Like

The only thing about reading "Advanced R" is I would suggest reading 2nd edition since it uses rlang and purrr which makes your life slightly easier over using base R as it was done in the 1st edition:

https://adv-r.hadley.nz/

It is work in progress, so some stuff might change, but it shouldn't be too bad.

2 Likes

There's no good guy or bad guy. I really wasn't trying to put you down or criticize. I apologise if you took offense. I think it's good to take a step back and remember this community is to learn and discuss ideas with each other. Your arguments are valid and common, but I disagree with your conclusion.

Here's an example of a popular website you might have seen that's written in R, https://www.tidyverse.org

Here's the source code uses to build it, https://github.com/tidyverse/tidyverse.org

You could make the argument that R isn't really generating the website, but it's definitely written using Rmarkdown. Technically it uses the package blogdown which turns Rmarkdown files and renders them as markdown and html suitable for the hugo content management system, which is actually written in Go. That said, there are other systems and packages for turning Rmarkdown into websites. You can include as much or as little html and JavaScript into your Rmarkdown file (or relevant file directory) as you want. To find out more, check out https://rmarkdown.rstudio.com/rmarkdown_websites.html

To your points, the validity of a programming is partially defined by what you can do with them. That's a fair point. Most people are not building websites with R. Most people are building websites with a combination of HTML, JavaScript, CSS (and/or LESS, SASS, and a ton of other styling frameworks) plus a backend/server side language (python, Ruby, Go, Java, etc). R is just as capable and valid for a backend service as the others, though not as typical as a choice because of the ecosystem (developers and packages available). So really, even though the only people programming in R that you know are only doing data science work and usually only hear about using R for data science work, that doesn't mean R can't be used for more generic proposes.

As for databases, you're right that typically other languages are used. That's because databases need to be fast and efficient otherwise they are pointless. You totally use languages that can directly control the hardware of the computer, specifically disk and memory. That's why C, C++, and recently go and rust have been popular for writing databases. You could write a database in R, but it would most likely be reaching out to the subsystem (operating system, installed on hardware or virtual) to do most of the work.

So yes, I agree that R is the best language for data science and not the best for other things programmers do, like build websites or write databases or building cryptography/security applications, etc. I disagree that R is not a real programming language and I hope I've given enough support that you'll see why.

7 Likes

Thanks for your reply

A couple of days back I posted a question as to what second programming language should I learn with r. Because I had experience with vba in excel but I could not build anything concrete out of it, it's made to be used only in ms office ecosystem. Then I learn sql which is only for databases, even though I learned architecture I needed something else with it. With R I liked shiny. But somehow I feel I just couldn't express myself into a programme with that as well. It just feels compact and not granular...

I would never ever had to learn other language or even bothered to learn if only it was exactly as you said. Like a python person can stay in his zone for everything I mean literally everything. From webpages to apps to dashboards.

But then I guess I am not a programmer and not with a computer science background so I shouldn't even bother about it. But when I have to explain my ideas to development team and it takes like forever... I feel like it is so simple I could have done it in half the time I took in explaining them.I just feel like need something more out of it what I really don't know. But something is missing for sure.

I would really love r to have a framework for building webpages , mobile app and desktop app and so on...maybe something else too I don't know.

But I am happy with r because my job gets done easier and faster and better. Hope you would understand what I just said

2 Likes

I use R for nearly all of my programming needs, including parsing complex text files using regexps, as mentioned by @Leon :wink:: I find the rebus+stringr combo to be far superior to Perl (but that could be because my few Perl scripts are basically baby Perl).

However, there are two things I don't use it for:

  1. Deep learning. Sure, you can use keras and tensorflow in R too, now, but all my coworkers use Python, so I need to use it on order to ensure that collaboration and reuse of code is as smooth as possible. Not only that, but all our supercomputing environment is configured for Python (GPU libraries, NVIDIA Docker images, etc.) and I really don't want to go through the hassle of reinstalling/reimaging everything. Also, to use PyTorch in R (which I like a lot) I could use reticulate, but it's really easier to just use Python.

It may also be a matter of habit - I've been doing statistical analyses from day one in R (well, day three...day one was Excel :scream: and day two was Matlab :fearful:) and I'll continue doing that. I've been doing Deep Learning in Python since day one, and I'll keep doing that, even though, in my efforts to give back to the R community, I plan to convert my "Deep Learning the easy way" presentation in R, sooner or later (it's currently in PowerPoint, using Python for examples).

  1. A few preprocessing steps when I need to concatenate multiple csv files, to get a final file whose size is in the tens of Gigabytes. This is easily done with a bash script, two or three lines long, without needing much RAM. I could do that in R, but it's more complex and slower.
4 Likes

it's like you can do one thing in thousand ways. shouldn't it be thousand things in a single way.

I think one of the strengths of R – though like many of the other things discussed here, it's more of R's culture and ecosystem than something mandated by the language — is it's perfectly acceptable to do one thing in many different ways. There are negatives to this, but I never liked the attitude in the Python community (for instance) of always finding the most Pythonic way of doing things.

This attitude trickles into the R ecosystem, where you have developers working on seemingly redundant projects (you bring up data.table and dplyr). Again, I think this is good. A lot of us who are statistics-oriented migrated from software that imposed a small set of possible tasks and we like R for its flexibility to do exactly what we want. Likewise, even the best R package or set of R packages may unintentionally be inflexible for some kind of task and I really like that there may be one or more well-developed alternatives for any given task.

There are some downsides, as you say. It's hard to know what the "best" way is and sometimes there really is a "best" way. You might say the talent and manpower of the developers working on overlapping packages could be more efficiently put towards non-overlapping projects. That said, it's worth recognizing the benefits.

5 Likes

I get it. I get it but its like thousands of developer are building more or less exactly the same thing.

I wish they could create a few packages and let people add functionality on to very same package. So that all descriptive has one package all inferential has one all Bayesian have one all non interactive graph have one all interactive graph have one.

Then it's like most efficient one would remain and redundant would fall off.

We as a statistician are growing I agree, I love that and I too wish to move in the same direction (I can always hire a programmer to do other jobs) but I believe and I could be totally wrong we are not moving in the direction of programming.

All the programming languages have started implementing machine learning libraries including c, java, js, julia and even go. Just like python did in just a few years, I fear after a few years we might (not absolutely sure) loose the edge we have in number crunching statically libraries.

But again no-one can predict anything that far.

And some how I have opened this conversation with a wrong foot. Everybody is trying to reply me. I am not against anybody I am in your team. But I just replied to the post. Nothing else.

Please don't take me the wrong way

@raybuhr You were being harsh with @Anantadinath and it came off as pretentious. Actually, R is a statistical software environment with a language tacked on to it. It is a domain specific language if you want to be exact about it. It is not a general purpose programming language like Python nor should it be compared to it. It is more like SAS in terms of what should be its direct competitor. Think about it this way, would you develop stand alone software in R? I wouldn't. Python or C++ would be much better in that regard.
One of the big issues in getting people to learn R is that instructors try to teach it as a computer language instead of just getting people to use R to analyze and graph data. Using the programming part of R is an advanced skill. To be charitable, learning the programming side of R can make you a more efficient analyst, but it is something that comes with time and need.

1 Like

Thank you very much.

Exactly my point. I learned R because I didn't had to write loop for every small column multiplication like I used to in vba and all it had was functions and nothing else.

It reminded me of excel and it still does. Which by the way is used by more people than entire computer science people combined.

It's easy and fun and let's you forget that it is a programming language.I didn't even realize that it was a programming language for a month or 2. Until I had to right loops again.

I love it the way it is.

@Anantadinath R is an wonderful environment to analyze data. It was made for statisticians by statisticians and it does its job really well. There is a reason why the book by Hadley Wickham is called "Advanced R." I really hate the flame wars people have about R and languages like Python (Which is a general purpose programming language with data analysis capabilities tacked on). I don't know what it is about the programming culture, but there is a snob factor to it that I really don't like. Most stats people that I have met are not that way.

1 Like

Thanks For understanding

Yes, I agree that my response was a bit harsh and pretentious which is why I apologized after.

I still disagree about R not being a full programming language. It definitely can be difficult to know what packages to use to develop reliable, maintainable software, but that doesn't mean it's impossible or even unpleasant. I like writing software in R. Maybe you don't. I don't think either of our preference has any bearing on whether it can be done.

Personally I find your comparison of R to SAS naive, but I can understand why you might think that and I don't think you are naive. I think a big part of the problem with the acceptance of R in enterprise is exactly the arguments you make. I think we need more R programmers -- people who write high quality software in R, not just data analysts automating their work -- to be about to set the examples needed to disprove your argument. Until then, comments about R only being a statistical environment will continue to limit the use cases and adoption of R for new projects in professional environments. I hope that explains my arguments and motivations a bit better without being offensive.

4 Likes

You don't need to apologize I didn't took offence but I didn't want to come out as anti R or something...

I wish you luck in your endeavors. I would be glad if you can help R move more into programming side.

Best of luck my friend

:grinning::grinning: