Comments (8)
For the first issue, see sjmisc::flat_table()
.
from sjmisc.
Thanks, but I already tried that earlier without success. Could it be that flat_table()
only shows values for which there exists a label and omits all other values from the output?
from sjmisc.
Yes, you're right. You have to wrap the data frame in fill_labels()
:
x <- sample(1:4, 20, T)
y <- sample(1:4, 20, T)
set_labels(x) <- c(`first` = 1, `third` = 3, `fourth` = 4)
set_labels(y) <- c(`second` = 2, `fourth` = 4)
tib <- tibble::tibble(x, y)
flat_table(fill_labels(tib), x, y)
else, use to_label()
:
tib <- to_label(tib, add.non.labelled = T)
ftable(tib$x, tib$y)
from sjmisc.
I think it doesn't make sense to exclude non-labelled values, so I fixed this.
from sjmisc.
Thank you for the update! What do you think about showing variable labels for frq()
and fill_table()
? In my opinion this would make them basically "swiss army knives" so that one can have a brief look at all important information about variables with one single (non-html) command. If you want I can also open another issue for this.
By the way: I am just in the process of converting a Data Analysis course for Social Scientists from Stata to R and thanks to your package this works out incredibly well! :)
from sjmisc.
For frq()
, variable labels are already shown (in the current GitHub-build). For flat_table()
, I have no good idea where to show the labels, because you can have a table with 2, 3, 4 or more variables. And the object itself is an ftable()
, so I can't easily format/manipulate the console-output.
By the way: I am just in the process of converting a Data Analysis course for Social Scientists from Stata to R and thanks to your package this works out incredibly well! :)
Glad to hear that, and thanks for the feedbacks you provide - this helps me improving the package not only for other users, but also for my purposes.
from sjmisc.
I see, thanks for the frq()
update. There is one more thing I would like to suggest: I think frq()
should either not display value labels for which no observations are occurent at all, or have a parameter which would enable this behavior. The background is the following: In several datasets I work with there are much more value labels assigned than actually observed later on. Using frq()
on such variables spams the screen with a lot of unnecessary information. I am not sure whether this change is relevant for SPSS datasets, but it definitely is for Stata.
Edit: This would be equivalent to skip.zero
from sjt.frq()
right?
from sjmisc.
As a First workaround you could wrap the variable in drop_labels()
.
from sjmisc.
Related Issues (20)
- Rec bug with "lo" characters
- select_helpers not working HOT 1
- Important bug in Rec HOT 2
- the speed of "rec" function slow when I use mutate with large dataset
- `move_columns` does not work when passed a variable in .after HOT 1
- rec and space strings
- Frequency of characters coercible as numerics
- Use str_contains for dataframe? HOT 2
- merge_imputations only providing a subset of variables
- Merges multiple imputed data frames into a single data frame HOT 3
- row_means() proportion of datapoints HOT 2
- FR: allow more printing formatting for frq HOT 1
- weights argument fails when using dplyr group_by
- frq fails when used for more than 1 variable and after `dplyr::group_by`
- Does not merge when data are in long format HOT 1
- Feature request: use -c syntax for descr "show" argument
- Issue with weighted percentage in `flat_table()`
- Issue with rec() else=copy not passing old labels
- sjmisc::rec() - val.labels function is not working
- sjmisc::rec generated factors not in the expected order
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sjmisc.