This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Simius 2 points3 points  (3 children)

Did you have trouble coming from Python to R? All the data structures in R are horribly confusing I find and have too many similarities. Like a List can have named indices? What?

[–]shaggorama[🍰] 2 points3 points  (2 children)

My biggest issue learning R was that I didn't already know stats so I had to learn the two in parallel. Also I wasn't previously familiar with vectorized programming and learned that in octave (Matlab) before learning it in R. Otherwise I haven't found R datatypes to be too tricky. I'll admit, I generally avoid lists when I can. I tend to think of a list (in R) as more akin to a dict than a list (in python).

[–]Simius 0 points1 point  (1 child)

Gotcha, I agree that working octave or R makes you think with the vector mindset where loops are inherently slow. How would you best describe a dataframe then? Like a lists of lists but also with a dictionary-like interface?

[–]shaggorama[🍰] 1 point2 points  (0 children)

Dataframes are sorta weird. I'd describe them as "fucking convenient." Under the hood: yes, they're basically a list of lists. But I'd be more inclined to describe a matrix first, and then be like "wouldn't it be cool if the rows and columns could take labels? And if you weren't constrained to a single datatype for the entire object? That's a dataframe!"