Get type of all variables

后端 未结 6 743
我寻月下人不归
我寻月下人不归 2020-12-12 12:37

In R, I\'d like to retrieve a list of global variables at the end of my script and iterate over them. Here is my code

#declare a few sample variables
a<-1         


        
6条回答
  •  有刺的猬
    2020-12-12 13:20

    You can use class(x) to check the variable type. If requirement is to check all variables type of a data frame then sapply(x, class) can be used.

提交回复
热议问题