How R Language works [closed] - r

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I was kind of wondering,how R language works internally when we type some command..
Say License()
As per my understanding,R language is made of packages,When we execute some command,it invokes the Right package,i was not able to find some documentation supporting this..
Research done from side:
1.closest i could get is below link
https://cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
2.I searched using "How R Language works internally",but i could not get any relevant results..
Below is how SQLServer executes a query from starting to end ,i am looking to see similar kind of documentation/any pointers for R
please let me know if you have any pointers

The notion that the R language is "made of packages" is inaccurate. It is made of commands, operators and functions, like other programming languages. Those commands are grouped into namespaces which comprise commands that belong to the same topic. A package provides a set of specific commands (and sometimes other objects, like sample data) grouped into a namespace. By loading a library (there are subtle semantic differences between a library and a package) the namespace of the package becomes available in the global environment, thereby making these commands directly accessible.

On the suggestion of #CapelliC here is a fully typed answer.
The internals of R are included in the document: https://cran.r-project.org/doc/manuals/r-release/R-ints.html
It is not an easy read, but covers all of the detail. My advice would be search the document if you have a specific query...

Related

What is currently the best workflow for statistical analysis and report writing? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Workflow for statistical analysis and report writing
This question had a lot of good answers, but as pointed out, they are outdated.
I mostly work on scripts that will probably never be re-run after a paper has been published. Are packages worth the trouble in cases where I don't need to redistribute the codes to the world for easy access? What about the organization of data? How can makefiles be used?
I think if you use the basics laid out by Josh Reichs in that post you provided, making sure that you create a directory to save everything in, then you are good to go.
My added step for the modern world would be to product a markdown report in one of the available formats.
rMarkdown- which you can run right out of rStudio
rNotebooks - which
you can run right out of rStudio
Jupyter Notebooks - which you can
run out of Anaconda or Jupyter with some easy tweaking.
The beauty of these three report systems is that you get to integrate the thought process, code, data, graphs and visualizations in a single spot.
So, if as you say no one will ever re-run your code, then they will at least see it to appease suspicions. Also, if they do choose to repeat your process, they just follow your logic and process in a duplicate document (especially easy with the notebooks)
As for using packages. That is a more complex question. If the packages are well orchestrated and save you a ton of time cleaning, sorting and structuring data, USE THEM! Time is money. If the things you are using them for are simple, straight forward, just as easy to program yourself and recognizable by those who would jury your paper, it probably does not matter either way.
The one place where I feel it matters is complex processes that are difficult (read that as easy to do wrong yourself) and have been implemented, tested and vetted by prior researchers.
Using those packages garners credibility and makes it easier for peers to accept your methods at face value. But if you are on the cutting edge..you should feel free to slice away. Maybe make a package of your own!

Should I make my R developments a package? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am developing a set of R scripts to post-process experimental data.
Currently, these are just scripts that I load individually by manually sourcing them.
I wonder if it would be better to put all those scripts in an R package, but as I constantly add/modify my library functions, I don't really know if this is the recommended way of doing it.
So my question is: should I go on working on "independent" script files or package them?
It is always good to bundle your scripts into a package. which will help you in lot many ways.
All your project fundamentals will be packed together
code portability will be lot easier
you can have test cases for your function using testthat package
You can have proper documentation for your code using roxygen2 package, which will help the readers or other users of the code to understand mode about the code.
you don't have to load your data and functions manually, you just have to load your package by saying library(package_name)
for more details about "R package": http://r-pkgs.had.co.nz/

Can I write go library to be used from another languages? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm writing relatively small, but not simple networking library which is going to be used at least from C,java,python,ruby and C#. Is there a way to make go bindings to the other languages the way in can be done form C? If not is there other way?
Right now, you can't write libraries in Go that can be used in other languages. Go has a runtime environment that does a lot of things (like sheduling go-routines, collecting garbage) for you. This runtime environment is written under the assumption that it controls the whole program. This assumption does not hold if Go code would be used from inside another language, as the Go library cannot influence the binary that uses it.
I imagine that a JSON service would do what you describe.
Have a look at the json test for a simple example
It wouldnt matter what languages you used to set and get data from your app

Translate SPSS syntax files to R source code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
A friend is in search of a method to translate SPSS 'syntax' files to semantically equivalent R source code files.
I suppose, no one ever wrote a translator. But maybe I'm wrong.
PS: Please excuse the wrong use of 'syntax': People using SPSS tend to name an SPSS source program a 'syntax file' ;-)
The short answer is that sorry, you are right, there is no tool for automatically translating SPSS script to R script. Even worse, such a tool would likely take several (many?) man-years to create, so don't hold your breath.
A small concession is that it is probably not to hard to create a tool for translating very small, specific subsets of SPSS to R. For example, if you have a chunk of code for reading in CSV files, then you could use regular expressions to extract the useful bits from the SPSS code and autogenerate some R code from them. In most instances however it will be far easier and faster to manually port the code yourself.
If all else fails, ask Bob Muenchen; he know a lot about porting SPSS to R.
Another option for this is SPSStoR, which claims to be able to translate many common (but basic) SPSS procedures to R code. It seems to be under active development on GitHub as of August 2014.
I know it's been more than 3 years after the question was originally asked, but it's worth noting that a German company by the name of eoda is actually working on such software. It's called translateR. It is currently in beta status and you can register for a beta test on their website.

why people use org.proj.subproj in most of java libs [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I wanted to go through java project publishing cycle and I've noticed people mostly use "org"."projectname".etc so i was wondering about this style advantages and why org is very much common ?
A Book or tutorial of such stuff would be great.
It is amazing what a simple search like "java package naming conventions" can yield in Google.
Java Package Naming Conventions
by Wikipedia.
The Java Tutorial: Naming a
Package
Java Language Specification: Unique
Package Names
org. is commonly (though not always) used for open source projects because they are released in a not-for-profit way. However, within companies you will find a lot of code using com.companyname, or even just companyname. or projectname. (the latter two styles are not recommended.) So I don't think it's true that "most people" use org - that's just what it looks like because you can't see all of that private company code on the Internet!
The reason for all this is that Sun, the company that created Java, recommends that people put classes in packages named after their domain name, reversed, and create subpackages within that to be unique within their organisation. The purpose is to avoid name clashes. That is why apache packages start with org.apache, for example - because apache's main domain name is apache.org.

Resources