Worth learning when I already hate MATLAB? Or Python instead?

worth learning when I already hate MATLAB? Or Python instead?

It's easy as fuck, but Python has more varied applications. I love R though.

If you are planning on doing anything with data/statistics in the future, R is fucking wonderful, and I would recommend learning it.
It is pretty specialist though so I wouldn't learn it unless you like stats.

Personally, I love R and hate MATLAB, but I am a statistician so it is obvious why.

Never used R, have to use Matlab for work but like Python way more. Although if you dislike Matlab, probably you will not like python since the parts where the two are comparable everything is almost exactly the same.

R is great for statistics. Just don't be a CS brainlet who only thinks in loops; remember to vectorize everything you can.

Python and R are used about equally often in data science. It's probably enough to know one of the two very well but it's obviously even better to know both.

If you are the kind of person who self-identifies as a "data scientist" you could learn Python instead.
For most statisticians' needs R is the go-to language.

>I love R and hate MATLAB, but I am a statistician so it is obvious why.
No. It is because you have a brain.
Matlab is fucking awful, the FOSS clone actually managed to create a better language (although not by much).

t. Does a lot of things with matalb

R has tons of packages available. So many students creating actually useful packages as part of their master or phd. No commercial software like Matlab can keep pace with this. The real question is R or Python, and it's the eternal question. R is the most ergonomic one, both can be really fast (depends on the packages you use)

>FOSS clone
Octave, Scilab or Julia?

Octave of course, it tries to emulate the syntax and functionality.

You really can not call Scilab or Julia "clones".

You should learn python anyway. If you are familiar with matlab at all, it is pretty easy.

>tfw 118 IQ but can't load a data file into this for my entry level stats class
Am I retarded?

if its a csv with header columns just type into R
read.csv(file.choose(),header=TRUE)

Yes.

anything below 130 IQ is

tfw strongly prefer Eviews and SPSS but R is too important to avoid using

It does worth learning. Both R and python. Matlab is you are an engineer, they have some shit for simulations.

lol terrible opinion. how do you prefer spss that shit is garbage and doesn’t hold a candle to R

Bullshit. The only reason python is on the map for data science applications is because devs don't want to deploy R code in the wild and deep learning is still getting a shitton of attention. Scikitlearn and numpy were hardly on the map before deep learning took off. Pandas is just a clunky attempt to port R's native data structures to Python.

>file.choose() instead of a pathname
>not using the readr meme

spss is shit yes but
i ned gui

Still doesn't work. REE

Why? R has all the functions you need; you just have to type them out. It's not as if you have to manually do the matrix multiplications for PCA or anything. Most of the common routines just werk™. There are some basic GUIs for some applications in R too. I don't know if you can import data with Shiny apps, but they're a meme right now (interactive web graphics) and if you can import you might find something useful.

data = read.csv("fertilityrate.csv", header = TRUE)

Seeand you're using a mac, so yeah brainlet confirmed.

Also make sure "fertilityrate.csv" is in your current working directory. To check that, run getwd()

You can always give it a full pathname, like "C:/data/fertilityrate.csv" or "~/fertilityrate.csv" etc.

Remember whenever you're giving a filename to put the quotes so it's a string (it will try and look for a variable named fertilityrate.csv if you don't put the quotes, for instance).

You final problem was not including header = TRUE within the parentheses. You're sending that argument to the read.csv() function so it needs to be included in read.csv()'s parentheses.

I fucking love R.
It's shit for everything that includes a for cycle, but it is absolute love if you are planning something to work with vector and data in general.
It has a major drawback, tho: it's very difficult to read the code, tho.

for someone who loves Matlab but is finishing uni and losing access to his fancy calculator, whats a good free alternative? Octave? R?

Are you retarded

>It's shit for everything that includes a for cycle
Rcpp is nearly identical to R syntax now (incl vectorisation syntactic sugar) so you have that option.

>It has a major drawback, tho: it's very difficult to read the code, tho.
mfw the following idiom is taken to its logical conclusion
data[data[, var] == 1, "var2"]

Th-thanks I think it works now.

Tnx, didn't know about that.

> 10/10 built-in retarded users prevention
hist(results[results[,3] < 10, "sd"])

Make sure to put your code in a file so you can rerun + you can run your analysis line by line with the Run button. I can't tell if you're doing that already tho.

I'm going to work on it later this evening so if you could keep the thread open if I have any questions that'd be really nice of you

And yes, I'm using the script window

>tidyverse

hello rèddit

>The real question is R or Python, and it's the eternal question.
I'd say the answer is down to use case. I use both for different purposes.

>it's very difficult to read the code
that's the fault of whoever wrote that shitpile, not the language.

Consider this instead:

================
# Y Constants
frontHalfY

Guys how do I compute missing values between 2001 and 2007, is.na isn't working.

what are X2001 and X2007? Are those variables? What's your data structure?

The context is generating parameters that are used to describe the mean and standard deviation of a normal distribution that underlies "x" at time T...

All good senpai I figured it out.

>Write your #own function which, given a vector as input, returns the number of #missing values.

Help

I know missingvalues20012007 is my vector, so how do I build a function around it?

function.x

you're in Rstudio, right? use Rstudio

I need it to find everything that isn't 0, e.g. a missing value.
I am lmao, I'm just a 118IQ brainlet

user...come on now. Use the internet to your advantage and stop asking people to spoon feed you your R homework. Check Stackoverflow.

okay I'll stop posting. I figured out the last one on my own so I should be alright. It took me 5 days of trying before this thread helped me import a csv into rstudio so I feel like I'm on a roll now.

I'm a slow learner.

I would suggest getting some materials/resources that you can always have on hand. Pic related is what I started with the first year of my PhD. It contains plenty of R code to help you along and covers up to regression/ANOVA techniques (if I remember correctly).

RStudio sucks

user.opinion=NULL

i dont know how anyone stands using it with the response lag it has for even simple expressions. there's a noticeable delay even for addition of two numbers in RStudio that just isn't there in RGui

So a response lag for simple calculations overwhelms the utility of the RStudio interface for you. Interesting.

Yes, it does. I don't find the environment pane or variable previewers useful, I don't want function hinting, the REPL is slow, and notepad++ offers syntax highlighting just as good as RStudio's file viewer. The only feature I envy in RStudio that RGui doesn't have is evaluation of highlighted code, but copying and pasting from a working document alongside the REPL is fine with me.

Whatever works for you, user.

Any other SO plebs?

>not exclusively posting on MathOverflow

b r a i n l e t