拆分表格时保持细胞颜色嗨,
我用了示例Sample 49836将一列中的单元格按不同列中的值着色 ,但现在我需要分割表并保持单元格颜色。
我之前看过关于连接表的讨论,其中一些关于如何再次获得颜色的工作。
使用拆分表有类似的方法吗?
谢谢
回复:分割表格时保持单元格颜色再次感谢您的帮助,我将使用您的示例并相应地调整代码。
回复:分割表格时保持单元格颜色我知道你没有提供关于你的分裂的准确信息。 我提供我生成的例子的意图是给你一个解决问题必须采取的一般方法的例子。 我假设您应该能够采用我给出的示例并进行扩展和更改以满足您的精确规格。
回复:分割表格时保持单元格颜色感谢您及时的回复,
问题是我需要将表拆分为其他列,然后是用于设置颜色的列。
在我们的例子中,我需要将表拆分为:sex,而颜色由:age定义。
dtSplit = DT < < 分裂 ( 拆分 ( : 性别 ) ,分裂 ( : 高度 ) ,剩余的列 ( 下降所有 ) ,排序方式柱属性 ) ;
再次感谢,
然
回复:分割表格时保持单元格颜色以下是您引用的示例的扩展,它可能会为您提供有关如何传输颜色的一些提示
/* Open a sample data table */
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
/* Obtain a list of unique values of age */
Summarize( a = By( :age ) );
/* Assign rowstate colors by the values in the age column */
dt << Color by Column( :age, Color Theme( "JMP Dark" ) );
/* Loop through each unique age and assign the rowstate color to the Color Cells */
For( i = 1, i <= N Items( a ), i++,
r = As List( dt << Get Rows Where( :age == Num( a[i] ) ) );
Column( dt, "height" ) << Color Cells( Color Of( Row State( r[1] ) ), r );
);
dtSplit = dt << Split( Split By( :age ), Split( :height ), Remaining Columns( Drop All ), Sort by Column Property );
// loop across all of the columns, and color the non missing cells with the
// color they had in the original data table
For( i = 1, i <= N Cols( dtSplit ), i++,
// Create a row list from the original table, based upon the column name
// in the split data table
r = As List( dt << Get Rows Where( :age == Num( Column( dtSplit, i ) << get name ) ) );
// Create a list of non missing rows in the split data table
r1 = As List( dtSplit << Get Rows Where( Is Missing( Column( dtSplit, i )[Row()] ) == 0 ) );
// Point back to the original data table and get the color from the row state
Current Data Table( dt );
TheColor = Color Of( Row State( r[1] ) );
// Point to the split table, and set the color of all of the
// non missing cells to the color found in the original table
Current Data Table( dtSplit );
Column( dtSplit, i ) << Color Cells( TheColor, r1 );
);
回复:分割表格时保持单元格颜色这是一个,对不起,我没有把链接放在我的第一篇文章中。
分裂后,我得到许多没有任何颜色的连续列。
我注意到的奇怪的事情是,当我分割彩色字符列时,我确实得到颜色但不是正确的颜色..
如果颜色正确,我可以将列更改为Charecter,拆分然后再更改为Continues,但无论如何它不是一个优雅的解决方案。
再次感谢
回复:分割表格时保持单元格颜色我认为OP指的是这个支持说明 。
回复:分割表格时保持单元格颜色请原谅我的无知,但我在哪里可以找到 “样本49836将一列中的单元格按不同列中的值着色”。
没有直接的方法来保持单元格的颜色,但如果我能看到您引用的样本的细节,我可能能够制定解决方案。