代码拉取完成,页面将自动刷新
同步操作将从 连享会/eda 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
********************************************************************************
* Description of the Program - *
* Utility to split variable labels for multiline titles/axis titles *
* *
* Program Output - *
* char varname[ti1] - First half of graph titles/labels for this variable *
* char varname[ti2] - Second half of graph titles/labels for this variable *
* char varname[title] - A string that can be used for titles in graphs *
* *
* Lines - *
* 78 *
* *
********************************************************************************
*! grlabsplit
*! v 0.0.1
*! 17jul2018
// Drop program from memory if loaded
cap prog drop grlabsplit
// EDA subroutine that writes split graph titles to dataset characteristics
prog def grlabsplit
// Requires a variable list
syntax varlist [, GRLABLength(int 50)]
// Loop over variable list
foreach v in `varlist' {
// Get variable label
loc graphlab : var l `v'
// Remove apostrophes
loc graphlab : subinstr loc graphlab "'" "", all
// Get the length of the x-axis variable lable
loc lablength : length loc graphlab
// Get the number of chunks needed to split the label
loc chunks = ceil(`lablength' / `grlablength')
// Make sure to allocate enough chunks in cases where the label length
// is less than the grlablength parameter
if `lablength' > `grlablength' & `chunks' < 2 {
// Add one to the chunk macro
loc chunks = 2
} // End IF Block for shorter variable labels than split length
// Holder for title string
loc title `""'
// If the variable label is longer than `grlablength' characters split it
forv i = 1/`chunks' {
// Extracts a chunk from the variable label
loc tmplab : piece `i' `grlablength' of `"`: var label `v''"', nobreak
// Stores the label chunk in a characteristic
char `v'[ti_chunk_`i'] "`tmplab'"
// Add chunk to title string
loc title `"`title'"`tmplab'" "'
} // End IF Block for splitting variable labels
// Store the title string in a characteristic
char `v'[title] "`title'"
// Store the length of the original label
char `v'[lablen] `lablength'
} // End Loop over variable list
// End of subroutine for splitting variable labels for titles
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。