New to learning R? Here are some frequently asked questions

code preview #rstats
code preview #rstats

#R or Python? Why both?

Lots of arguments for learning both: This provides some resources and insights.

For fun, imagine being about to code access Python modules, classes, and functions in R. Check out the reticulate package.

#What’s a tibble?

A tibble is a data structure. It is a “modern dataframe”.  Tibbles are relatively new in R.  Learn more about the features.

#What is the default number of digits displayed by R?

From my research it appears that default is 7. But you can change it. Learn more at:

#Do spaces matter? Is there a difference between <- and < –  ?

Yes! <- is used for assignment of values to variables. For example, the code below shows the value of 1 being assigned to the variable named x.

x <-1

On the other hand the following code shows that using a space between the less than sign and the minus sign has an entirely different meaning. Instead this < is used a logical operator evaluating the truth of the statement x is less than -1. The answer returned is the boolean value of FALSE. The statement is false since x has been assigned value of 1 in the statement above.

x < -1
[1] FALSE

See the video demonstration

 

 

As a leading expert on data visualization, Dr. Kristen Sosulski regularly consults, delivers seminars, and leads workshops on data visualization techniques and best practices.  Her book, Data Visualization Made Simple: Insights Into Becoming Visual (Routledge) will be published in later this year. Kristen is an Associate Professor at NYU’s Stern School of Business and the Director of Learning Sciences for the NYU Stern W.R. Berkley Innovation Labs.

Learn more about Kristen Sosulski at kristensosulski.com and follow her on twitter at @sosulski. Stay connected and join her newsletter.

New to R? Frequently asked questions and answers #rstats
Tagged on: