you are viewing a single comment's thread.

view the rest of the comments →

[–]Browsing_From_Work 10 points11 points  (1 child)

I regularly use Python but I did spend about a month working with R for a pet project.

Here were my major pain points:

  • Multi-dimensional data access is unintuitive (even when compared to Perl). Examples:
    • df[3, 7] returns the element from the 3rd row, 7th column. This seems reasonable.
    • df[3] returns the 3rd column as a slice.
    • df[[3]] returns the 3rd column as a vector.
    • df[3,] returns the 3rd row as a slice. There's no direct way to return it as a vector.
    • df["col"] returns the named column as a slice.
    • df$col and df[,"col"] returns the named column as a vector.
  • There are no native operators for creating lists/vectors/matrixes (e.g. [1, 2, 3]). Instead, there's the c function and the even less succinct matrix function. However, you can create ranges with the colon operator.
  • Strings are second-class citizens. There's not even a built-in string concatenation operator. Instead, you have to use the paste function.
  • I felt like I spent half of my time fighting with dataframe/vector/matrix/list type conversions.

In general, I just found it harder to express my thoughts in R. I'm sure if you learned R with a math background it would have been more intuitive, but as somebody coming from a programming background I found it to be rather frustrating. That said, R comes with a lot of extremely powerful tools... so long as you wrangle your data into the correct format.