Created
April 8, 2021 04:04
-
-
Save rhilfi/ab360d13f929600b369a869b08a4f74c to your computer and use it in GitHub Desktop.
lookfor_in_r_as_in_stata #r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("questionr") | |
library(questionr) | |
Thats_a_cool_variable =rnorm(100, 50,12) | |
Thats_a_less_cool_variable =rnorm(100,50,12) | |
Thats_an_even_cooler_variable=rnorm(100,40,21) | |
Does_R_makes_you_angry=rep(0:1,each=50) | |
Does_R_makes_you_happy=rep(c(1,0),each=50) | |
data<-data.frame(Thats_an_even_cooler_variable, Thats_a_cool_variable, Thats_a_less_cool_variable, Does_R_makes_you_angry, Does_R_makes_you_happy) | |
# Example that will yield nothing: | |
lookfor(data, "coll") | |
# Nothing found. Sorry. | |
# Example that will find something: | |
lookfor(data, "cool") | |
# pos variable label col_type values | |
# <chr> <chr> <chr> <chr> <chr> | |
# 1 Thats_an_even_cooler_variable — dbl range: -27.2974991135071 - 110.530582887605 | |
# 2 Thats_a_cool_variable — dbl range: 22.3679775441832 - 76.0718249742795 | |
# 3 Thats_a_less_cool_variable — dbl range: 26.4050546494277 - 73.8098660856932 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment