添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

hello everyone, i would request all experts in R to help me.
In str function, there's an argument vec.len, here's a screenshot from documentation
image 1336×129 14.4 KB It says this
The number is multiplied by different factors (from .5 to 3) depending on the kind of vector.
I am unable to understand the working and with which factor does it multiply with for which vector?
Pls cite the reference also
Thanks in advance:)

i used str method on mtcars data frame. here is the result, but all variables have 10 observations except for disp, which has 5 observations, why?
Screenshot 2021-09-22 162635 702×280 18.9 KB

also cite the reference if you have any

... at the end of each line indicates more values.

Confirm

check_lengths <- function(x) length(mtcars[,x]) == length(mtcars$disp)
the_vars <- colnames(mtcars)
results <- list()
for(i in seq_along(the_vars)) results[i] = check_lengths(i)
unlist(results)
#>  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
          

R is an interpreted language, like Python, not a complied language like C, Rust or Haskell, say. The source code doesn’t get compiled into binary. Every script is readable exactly the same way as the interpreter gets it to run through the terminal or the RStudio IDE. So, if you cut and paste the snippet, you should get the same results.