![]() x: The name of the column you want to add the attribute to in df. df: The data frame containing the column you want to add the attribute to.The arguments to cb_add_col_attributes() are: Column attributes can serve a similar function to variable labels in SAS or Stata however, you can assign many different attributes to a column and they can contain any kind of information you want. These attributes can later be accessed to fill in the column attributes table of the codebook document. The cb_add_col_attributes() function is a convenience function that allows you to add arbitrary attributes to the columns of the data frame. Typically, though not necessarily (see What if the variables already have labels?), the first step in creating your codebook will be to add column attributes to your data. Below, we will discuss adding the Column type attribute, which allows the user to add additional information about the values in each column.Īdd column attributes to the data frame you want to document with a codebook The value for Data type is just the value returned by passing the column to base R’s class() function.This is discussed in greater detail below. Which statistics are displayed depends on the what type of data the column contains. ![]() The bottom half of each column attributes table will include some basic descriptive statistics. Below, we will discuss other optional attributes that may be added to this table. By default, the top half of the column attributes table includes the column’s name, data type, the number of unique non-missing values, and the total number of missing values. The codebook will include a tables of column attributes for each column in the data frame passed to the codebook() function. The final row of the metadata table gives the date when the codebook (but not necessarily the data frame) was last updated. ![]() Currently, the data frame’s name, size, number of columns, and number of rows are included in the metadata table. This table includes some metadata about the data frame. You may also download it from the files pane above.Īs you may see in the example document above, the default codebook document includes two major sections. The code above produces the following document, which you can click to view/download on Dropbox. Print ( codebook ( study ), "basic_study_codebook.docx" ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |