Get type of all variables

后端 未结 6 775
我寻月下人不归
我寻月下人不归 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:34

    lapply(your_dataframe, class) gives you something like:

    $tikr [1] "factor"

    $Date [1] "Date"

    $Open [1] "numeric"

    $High [1] "numeric"

    ... etc.

提交回复
热议问题