Hello members, I am familiar with python's Numpy. Now I am looking into R language. What is the main difference between these two languages? including advantages or disadvantages. Thanks.
https://www.ibm.com/cloud/blog/python-vs-r On 2021-10-28 2:57 a.m., Catherine Walt wrote:> Hello members, > > I am familiar with python's Numpy. > Now I am looking into R language. > What is the main difference between these two languages? including advantages or disadvantages. > > Thanks. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Catherine, R is a program that is designed for the statistical analysis and visual display of data. Advantages and disadvantages depend on what you want to do with the language. John ________________________________________ From: R-help <r-help-bounces at r-project.org> on behalf of Catherine Walt <walt at purpleemail.com> Sent: Thursday, October 28, 2021 2:57 AM To: r-help at r-project.org Subject: [R] R vs Numpy Hello members, I am familiar with python's Numpy. Now I am looking into R language. What is the main difference between these two languages? including advantages or disadvantages. Thanks. ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=04%7C01%7CJSorkin%40som.umaryland.edu%7Cd7ce49543170430f10a208d99a3e8bc4%7C717009a620de461a88940312a395cac9%7C0%7C0%7C637710416263711233%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ada4s6jHFFpT09%2BnKV0hhXgA4dczZ88wNqqjMGED7Zg%3D&reserved=0 PLEASE do read the posting guide https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.html&data=04%7C01%7CJSorkin%40som.umaryland.edu%7Cd7ce49543170430f10a208d99a3e8bc4%7C717009a620de461a88940312a395cac9%7C0%7C0%7C637710416263711233%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qNxgDcGORjIZ4Q3BTkvdQ%2BRwODlFsFpFxwZCNyx06Vk%3D&reserved=0 and provide commented, minimal, self-contained, reproducible code.
This is dangerously close to off topic, or at least it could be fuel for divisive argument rather than informed discussion (most readers here might be short on details of NumPy and long on details regarding R). Have you used a search engine? Google found https://www.r-bloggers.com/2011/03/a-short-side-by-side-comparison-of-the-r-and-numpy-array-types/ for me. Under the hood, R and NumPy often use the same compiled code for numerical algorithms, so to some degree it is more a matter of taste in how you get at those algorithms. On October 27, 2021 11:57:14 PM PDT, Catherine Walt <walt at purpleemail.com> wrote:>Hello members, > >I am familiar with python's Numpy. >Now I am looking into R language. >What is the main difference between these two languages? including advantages or disadvantages. > >Thanks. > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- Sent from my phone. Please excuse my brevity.
I am not sure your overall question fits into this forum but a brief internet search can find plenty of info. But in brief, R is a language in which much of what numpy does was built in from the start and many things are vectorized. Much of what the python pandas language does is also part of native R. There are additional packages (python called them modules) freely available that greatly extend those capabilities and I doubt there is very much you can do in numpy that cannot also often easily be done in R. Realistically, there are several reasons the numpy module is so commonly used in python. They left something like vectors out of the language. Yes, they have dictionaries and lists and sets and all kinds of objects. So numpy was made mostly in C to provide numeric processing of things that are more like vectors efficiently. In R, everything is a vector as in a simple variable is just a vector of length one! I program in both and in other languages as many do. Reasons to choose one or another vary. Python can do many things easily and with complexity and is a rather full-blown and complex language with real object-oriented capabilities and also functional programming. It is interpreted but also has a way to save partially compiled code. R is pretty much all interpreted albeit many things are written I C or C++ pr other compiled languages and stuffed into libraries. One main reason to choose is programming style but there are TONS of differences that can bite you such as R sometimes deferring evaluation of code which can be an advantage or the opposite. But a huge reason I think that people choose one or the other is the availability of packages that do much of what they want. Some, for example, love a set of packages they call the tidyverse and do much of their work largely within it rather than base R. Many love the graphics package called ggplot. But over time, I see more and more functionality available within the Python community that rivals or perhaps exceeds such as the machine learning tools. I have an interesting solution I sometimes use as you can run programs in R using a package that allows the same data to be accessed back and forth between an attached R interpreter and a Python interpreter. So if you want to use python features like dictionaries and list comprehensions to massage the data then have R do additional things and perhaps make graphs, you can get some of both worlds. As noted, a detailed answer is way beyond here. R has packages that probably let you add things and it has too many object-oriented subsystems, most of them not complete. Good Luck, Avi -----Original Message----- From: R-help <r-help-bounces at r-project.org> On Behalf Of Catherine Walt Sent: Thursday, October 28, 2021 2:57 AM To: r-help at r-project.org Subject: [R] R vs Numpy Hello members, I am familiar with python's Numpy. Now I am looking into R language. What is the main difference between these two languages? including advantages or disadvantages. Thanks. ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On Thu, 28 Oct 2021, Catherine Walt writes:> Hello members, > > I am familiar with python's Numpy. > Now I am looking into R language. > What is the main difference between these two languages? including advantages or disadvantages. > > Thanks. >Perhaps also of interest: https://github.com/matloff/R-vs.-Python-for-Data-Science -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net
Thanks for Avi. and all other people's helps. I am using Numpy primarily for machine learning, for example, Keras tasks can use Numpy heavily. Now I got a task to analyze the BIO data, for which the Prof tell me R is better. So I am looking into R. and I was just serious if Numpy can handle the BIO data well? Regards Cathy October 29, 2021 3:32 AM, "Avi Gross via R-help" <r-help at r-project.org> wrote:> I am not sure your overall question fits into this forum but a brief > internet search can find plenty of info. > > But in brief, R is a language in which much of what numpy does was built in > from the start and many things are vectorized. Much of what the python > pandas language does is also part of native R. There are additional packages > (python called them modules) freely available that greatly extend those > capabilities and I doubt there is very much you can do in numpy that cannot > also often easily be done in R. > > Realistically, there are several reasons the numpy module is so commonly > used in python. They left something like vectors out of the language. Yes, > they have dictionaries and lists and sets and all kinds of objects. So numpy > was made mostly in C to provide numeric processing of things that are more > like vectors efficiently. In R, everything is a vector as in a simple > variable is just a vector of length one! > > I program in both and in other languages as many do. Reasons to choose one > or another vary. Python can do many things easily and with complexity and is > a rather full-blown and complex language with real object-oriented > capabilities and also functional programming. It is interpreted but also has > a way to save partially compiled code. R is pretty much all interpreted > albeit many things are written I C or C++ pr other compiled languages and > stuffed into libraries. > > One main reason to choose is programming style but there are TONS of > differences that can bite you such as R sometimes deferring evaluation of > code which can be an advantage or the opposite. But a huge reason I think > that people choose one or the other is the availability of packages that do > much of what they want. Some, for example, love a set of packages they call > the tidyverse and do much of their work largely within it rather than base > R. Many love the graphics package called ggplot. > > But over time, I see more and more functionality available within the Python > community that rivals or perhaps exceeds such as the machine learning tools. > > I have an interesting solution I sometimes use as you can run programs in R > using a package that allows the same data to be accessed back and forth > between an attached R interpreter and a Python interpreter. So if you want > to use python features like dictionaries and list comprehensions to massage > the data then have R do additional things and perhaps make graphs, you can > get some of both worlds. > > As noted, a detailed answer is way beyond here. R has packages that probably > let you add things and it has too many object-oriented subsystems, most of > them not complete. > > Good Luck, > > Avi > > -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of Catherine Walt > Sent: Thursday, October 28, 2021 2:57 AM > To: r-help at r-project.org > Subject: [R] R vs Numpy > > Hello members, > > I am familiar with python's Numpy. > Now I am looking into R language. > What is the main difference between these two languages? including > advantages or disadvantages. > > Thanks. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Reasons for preferring one to another: - taste. If you like curly braces, you'll prefer R. If you like indentation forced by syntax, you'll prefer Python. - compatibility. This morning I was trying to use a web site where all the Python examples were non-functional due to either of both of two changes to Python syntax. - tooling Both have pretty good tools. For some things, R has the edge. For some, Python. (There is no R analogue of PyPy.) - packages Both R and Python have vast libraries of contributed packages. Quite often you are more interested in a package than the language it runs in. You might be surprised at what is available for R. Tensorflow: https://tensorflow.rstudio.com/ Keras: https://keras.rstudio.com/ And of course, some people use both in the same project, https://www.rstudio.com/solutions/r-and-python/ By the way, someone said that R is purely interpreted. That's not completely true. In R, type ?compile>From .py files you get .pyc, from .R files you get .RcOn Fri, 29 Oct 2021 at 20:21, Catherine Walt <walt at purpleemail.com> wrote:> Thanks for Avi. and all other people's helps. > > I am using Numpy primarily for machine learning, for example, Keras tasks > can use Numpy heavily. > > Now I got a task to analyze the BIO data, for which the Prof tell me R is > better. > So I am looking into R. and I was just serious if Numpy can handle the BIO > data well? > > Regards > Cathy > > > > October 29, 2021 3:32 AM, "Avi Gross via R-help" <r-help at r-project.org> > wrote: > > > I am not sure your overall question fits into this forum but a brief > > internet search can find plenty of info. > > > > But in brief, R is a language in which much of what numpy does was built > in > > from the start and many things are vectorized. Much of what the python > > pandas language does is also part of native R. There are additional > packages > > (python called them modules) freely available that greatly extend those > > capabilities and I doubt there is very much you can do in numpy that > cannot > > also often easily be done in R. > > > > Realistically, there are several reasons the numpy module is so commonly > > used in python. They left something like vectors out of the language. > Yes, > > they have dictionaries and lists and sets and all kinds of objects. So > numpy > > was made mostly in C to provide numeric processing of things that are > more > > like vectors efficiently. In R, everything is a vector as in a simple > > variable is just a vector of length one! > > > > I program in both and in other languages as many do. Reasons to choose > one > > or another vary. Python can do many things easily and with complexity > and is > > a rather full-blown and complex language with real object-oriented > > capabilities and also functional programming. It is interpreted but also > has > > a way to save partially compiled code. R is pretty much all interpreted > > albeit many things are written I C or C++ pr other compiled languages and > > stuffed into libraries. > > > > One main reason to choose is programming style but there are TONS of > > differences that can bite you such as R sometimes deferring evaluation of > > code which can be an advantage or the opposite. But a huge reason I think > > that people choose one or the other is the availability of packages that > do > > much of what they want. Some, for example, love a set of packages they > call > > the tidyverse and do much of their work largely within it rather than > base > > R. Many love the graphics package called ggplot. > > > > But over time, I see more and more functionality available within the > Python > > community that rivals or perhaps exceeds such as the machine learning > tools. > > > > I have an interesting solution I sometimes use as you can run programs > in R > > using a package that allows the same data to be accessed back and forth > > between an attached R interpreter and a Python interpreter. So if you > want > > to use python features like dictionaries and list comprehensions to > massage > > the data then have R do additional things and perhaps make graphs, you > can > > get some of both worlds. > > > > As noted, a detailed answer is way beyond here. R has packages that > probably > > let you add things and it has too many object-oriented subsystems, most > of > > them not complete. > > > > Good Luck, > > > > Avi > > > > -----Original Message----- > > From: R-help <r-help-bounces at r-project.org> On Behalf Of Catherine Walt > > Sent: Thursday, October 28, 2021 2:57 AM > > To: r-help at r-project.org > > Subject: [R] R vs Numpy > > > > Hello members, > > > > I am familiar with python's Numpy. > > Now I am looking into R language. > > What is the main difference between these two languages? including > > advantages or disadvantages. > > > > Thanks. > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
If you are looking for expertise in answering questions about NumPy, the pool of experts will be smaller here than in a forum whose topic is NumPy. I don't know what "BIO" means... if it alludes to biostatistics then there is a whole separate Bioconductor project that specializes in applying R to that category of problem. Having a large pool of people building tools that you can use and answer questions about should count for something... but they do have their own forums dedicated to that specialty. https://support.bioconductor.org/ https://www.biostars.org/p/414140/ On October 29, 2021 12:14:21 AM PDT, Catherine Walt <walt at purpleemail.com> wrote:>Thanks for Avi. and all other people's helps. > >I am using Numpy primarily for machine learning, for example, Keras tasks can use Numpy heavily. > >Now I got a task to analyze the BIO data, for which the Prof tell me R is better. >So I am looking into R. and I was just serious if Numpy can handle the BIO data well? > >Regards >Cathy > > > >October 29, 2021 3:32 AM, "Avi Gross via R-help" <r-help at r-project.org> wrote: > >> I am not sure your overall question fits into this forum but a brief >> internet search can find plenty of info. >> >> But in brief, R is a language in which much of what numpy does was built in >> from the start and many things are vectorized. Much of what the python >> pandas language does is also part of native R. There are additional packages >> (python called them modules) freely available that greatly extend those >> capabilities and I doubt there is very much you can do in numpy that cannot >> also often easily be done in R. >> >> Realistically, there are several reasons the numpy module is so commonly >> used in python. They left something like vectors out of the language. Yes, >> they have dictionaries and lists and sets and all kinds of objects. So numpy >> was made mostly in C to provide numeric processing of things that are more >> like vectors efficiently. In R, everything is a vector as in a simple >> variable is just a vector of length one! >> >> I program in both and in other languages as many do. Reasons to choose one >> or another vary. Python can do many things easily and with complexity and is >> a rather full-blown and complex language with real object-oriented >> capabilities and also functional programming. It is interpreted but also has >> a way to save partially compiled code. R is pretty much all interpreted >> albeit many things are written I C or C++ pr other compiled languages and >> stuffed into libraries. >> >> One main reason to choose is programming style but there are TONS of >> differences that can bite you such as R sometimes deferring evaluation of >> code which can be an advantage or the opposite. But a huge reason I think >> that people choose one or the other is the availability of packages that do >> much of what they want. Some, for example, love a set of packages they call >> the tidyverse and do much of their work largely within it rather than base >> R. Many love the graphics package called ggplot. >> >> But over time, I see more and more functionality available within the Python >> community that rivals or perhaps exceeds such as the machine learning tools. >> >> I have an interesting solution I sometimes use as you can run programs in R >> using a package that allows the same data to be accessed back and forth >> between an attached R interpreter and a Python interpreter. So if you want >> to use python features like dictionaries and list comprehensions to massage >> the data then have R do additional things and perhaps make graphs, you can >> get some of both worlds. >> >> As noted, a detailed answer is way beyond here. R has packages that probably >> let you add things and it has too many object-oriented subsystems, most of >> them not complete. >> >> Good Luck, >> >> Avi >> >> -----Original Message----- >> From: R-help <r-help-bounces at r-project.org> On Behalf Of Catherine Walt >> Sent: Thursday, October 28, 2021 2:57 AM >> To: r-help at r-project.org >> Subject: [R] R vs Numpy >> >> Hello members, >> >> I am familiar with python's Numpy. >> Now I am looking into R language. >> What is the main difference between these two languages? including >> advantages or disadvantages. >> >> Thanks. >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- Sent from my phone. Please excuse my brevity.