如何將表格和影像循環到 ppt 投影片中嗨,我在 JMP 循環中陷入困境並陷入困境。 如何循環來自子集表的表格? 表格的數量可能會發生變化,所以我認為我需要進行循環(但我很掙扎),我還需要將此圖像附加到 powerpoint 幻燈片中。 我不知道如何獲取循環變數名稱並將其附加到幻燈片中。
這是我的範例腳本,但沒有任何循環。 是否可以?
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:Sex << Set Name( "Sex_Subset" );
dt << New Column( "Sex", Formula(:Sex_Subset));
dt1 = dt << Subset( By( :Sex_Subset ), All rows, Selected columns only( 0 ) );
//this is where to loop tabulated tables since column values used in subsetting dt may change number of values
//how to loop this according to data table name? is that possible?
dt_Tab = Tabulate(
Add Table(
Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
Row Table( Grouping Columns( :name, :age ) )
)
);
tab = dt_Tab << get picture; //variable name needs to be looped? for ppt slides
//after getting the plot as image, how can I append those images that were loop to ppt slides?
//for male table
hbppt1 = H List Box(tab) << get picture;
ppt1 = Outline Box( "Male", hbppt1 );
ppt1 << savepresentation( pathppt, append, PNG );
//for female table
hbppt2 = H List Box(tab2) << get picture;
ppt2 = Outline Box( "Female", hbppt2 );
ppt2 << savepresentation( pathppt, append, PNG );
子集的表
自動化和腳本編寫回覆:如何將表格和影像循環到 ppt 幻燈片中如果將 Subset 與 By 一起使用,您將獲得一個表格列表,然後可以循環遍歷該列表
dt1 = {DataTable("Sex_Subset=F"), DataTable("Sex_Subset=M")};
編輯:
檢查您正在使用的函數和訊息的腳本索引,其中一些不正確
Names Default To Here(1);
pathppt = "$TEMP/bigclass.pptx";
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "Sex") << Set Name("Sex_Subset");
dt << New Column("Sex", Formula(:Sex_Subset));
dt_subsets = dt << Subset(By(:Sex_Subset), All rows, Selected columns only(0));
For Each({dt_subset}, dt_subsets,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
tab_pic = subset_tab << get picture;
subset_tab << Close Window;
name_dt = dt_subset << get name;
Close(, no save);
hbppt = H List Box(tab_pic) << get picture;
ppt = Outline Box(name_dt, hbppt);
If(!File Exists(pathppt),
ppt << savepresentation(pathppt);
, // append only if file already exists
ppt << savepresentation(pathppt, append);
);
);
Open(pathppt);回覆:如何將表格和影像循環到 ppt 幻燈片中這是建立投影片的腳本的修改

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Specify the path to save the pptx's to
pathPPT = "$TEMP/UserID16644Slides.pptx";
:Sex << Set Name( "Sex_Subset" );
dt << New Column( "Sex", Formula( :Sex_Subset ) );
// Add value labels so the full value can be used for the slide title
dt:Sex_Subset << Value Labels( {"F" = "Female", "M" = "Male"} ) << Use Value Labels( 1 );
// Subset the tables. The dataTableList will contain a reference to each table created
dataTableList = dt << Subset( By( :Sex_Subset ), All rows, Selected columns only( 0 ) );
// Loop across all of the tables and create the Tabulates
For Each( {table, i}, dataTableList,
dt_Tab = table << Tabulate(
Add Table(
Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
Row Table( Grouping Columns( :name, :age ) )
)
);
// Pull the subset name from the data table name
theTitle = Word( 3, Char( dataTableList[i] ), "\!"=" );
// Create the new slide
hbppt1 = H List Box( dt_tab << get picture);
ppt1 = Outline Box( theTitle, hbppt1 );
// The pptx must exist for the append to be used, so on the first
// slide it is not appended
if(i==1,
ppt1 << savepresentation( pathppt,"PNG" ),
ppt1 << savepresentation( pathppt, Append,"PNG" )
);
);
// Open the powerpoint presentation to see the results
open(pathppt);
回覆:如何將表格和影像循環到 ppt 幻燈片中我還沒有 JMP 16,我嘗試將 For Each 循環轉換為 For 循環,但沒有得到任何輸出
For (i = 1, i <= dataTableList, i++,
dt_Tab = table << Tabulate(
Add Table(
Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
Row Table( Grouping Columns( :name, :age ) )
)
);
);
回覆:如何將表格和影像循環到 ppt 幻燈片中您好,我嘗試將 For Each 循環轉換為 For 但沒有得到輸出
For (i = 1, i <= dt_subsets, i++,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
);
回覆:如何將表格和影像循環到 ppt 幻燈片中dt_subsets 是 JMP 列表。您需要的是清單中的元素數量。
For (i = 1, i <= N Items( dt_subsets ), i++,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
);
回覆:如何將表格和影像循環到 ppt 幻燈片中我懂了。 另外,只是想知道 dt_subset 來自哪裡?

因為當我嘗試這行程式碼時, dt_subset ( dt_subset << 製表() )未找到。 但是,我嘗試用 dt_subsets 替換它,它列出了 2x 個表格(2 個男性表格和 2 個女性表格)
For (i = 1, i <= N Items( dt_subsets ), i++,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
);
回覆:如何將表格和影像循環到 ppt 幻燈片中它需要是
For (i = 1, i <= N Items( dataTableList ), i++,
回覆:如何將表格和影像循環到 ppt 幻燈片中變數
dt_子集
是一個錯誤,它需要
dt_子集