Correct Option: `1.3 2.3 3.3`. The binary operator `:` in R has two meanings. For factors `a:b` is equivalent to `interaction(a,b)` except the levels' labelling and ordering is different. For numeric arguments `from:to`, the result #RStats#DataScience [TimeStamp:11032021163031]
is equivalent to `seq(from:to)` which generates a sequence from `from` to `to` in steps of 1 or -1. [see_image_1] #RStats#DataScience [TimeStamp:11032021163031]
• • •
Missing some Tweet in this thread? You can try to
force a refresh
By default when you create a factor in R, the `NA`'s are not included as a level. Which of the following would include `NA` as a level? [see_image_1] #RStats#DataScience [TimeStamp:12032021033052]
Correct Option: `x = factor(c(1,1,2,NA), exclude=NULL)`. `factor()` takes an additional argument `exclude`, which can be used to exclude levels. `exclude` can be a vector, which excludes the characters (or numbers) from a given #RStats#DataScience [TimeStamp:12032021163031]
#rstats users who are planning to learn #python, welcome to another edition of tweetorial.
The idea is to leverage your experience with R to explain python concepts w/o going into too much detail. For details, refer the links attached at the bottom.
For today, I am covering the data types in python (except complex, binary types). R has data types: integer, double, character and boolean. Well python too has the same data types, although some names are different. In R `integer` cannot be a fractional and is written by
suffixing L, in python it's `int`. In R fractionals are called `double` (like 1.2), In python they are called `float`. In both R python it is not necessary to specify the type. While in R the type of a number is `double` unless specified by `L`, python infers it automatically.