r/AskProgramming • u/Feeling_Valuable5239 • Sep 22 '26
Does the C programming language provide statistical and data analysis libraries comparable to those available in R programming language?
0
Upvotes
12
u/kitsnet Sep 22 '26
What is your goal?
C is a very inconvenient language to work with data abstractions. You might better look at C++.
13
u/KeeperOfAngelsNorth Sep 22 '26
Not built in to the language the way they are provided with R but through libraries. A lot of of R's functionality is implemented as C libraries and compiled into the product.
The universe of C libraries is vast.
8
u/generally_unsuitable Sep 22 '26
Deep down, most high level languages are just fancy wrappers for libc.
So, your question is looking in the wrong direction.
3
u/arjuna93 Sep 23 '26
If by āavailable in Rā you mean R packages, then a lot of them are in C++ and Fortran. In fact the best ones are. Pure R is just for data handling/organizing.
3
u/StaggeredFermion Sep 23 '26
Like a lot of other folks are saying, C is not really a language you'd want to do full-fledged statistical/data analysis in; however, statistical/data analysis libraries (like SciPy) written in higher-level languages (like Python) for their front-end API often use C to implement performance-critical components in the backend. To some degree, there is some truth in the quip, "C is just 'portable assembly'"; there's a price to be paid in losing the higher-level abstractions that make writing statistical/data analysis software in higher-level languages less of a pain in the neck.
2
u/Individual-Flow9158 Sep 23 '26
I never get very far in R without needing to install several hundred things from https://cran.r-project.org
In C, there are indeed a few different ways, to link in the multitude of libraries available. I'm not sure how anything at all would be possible in R, if it couldn't also be done in C (perhaps super specific SIMD that needs Fortran, or optimised assembly).
But as everyone else says, C is not the right tool for this job.
2
u/GlobalCurry Sep 25 '26
Look into Julia if you want a high performance data language.
2
u/Odd-Heron5704 Sep 22 '26
Not as easy or as vast as R or Python, that's a great part of the point of those languages
1
u/SvenTropics Sep 23 '26
C and C++ can do everything basically, but you just need the right libraries.
What higher level languages excelled in was reducing functionality to prevent bad coding from being a problem.
1
u/Rich-Engineer2670 Sep 23 '26
C's power is that it's about as low-level as you can get before you see assembly language. NOTHING Is really there if it's not in a library somewhere.
-2
u/Prize_Bass_5061 Sep 22 '26
You need Python, not C. Are you programming embedded hardware?