たとえば、いくつかの関数をもう少し再利用可能にしたいと考えています。データ セットから特定の列を含む要約テーブルを作成しています。列リストを引数として渡して、 "GetExperimentsSummary" と "GetCompoundsSummary" ではなく 1 つの "GetSummary" 関数を使用できるようにしたいのですが、これらには異なる数の列が必要なので、列のリストを個別にパッケージ化 (おそらくクラス定義で) してから、1 つの引数として関数に渡す必要があります。これは jsl で可能ですか? 構文はどうなりますか? 以下は、実験の取得と化合物の取得の例です。私は JMP18 を使用しています。
//Get Experiments function
getexperimentssummary = function ({},
original_data << Summary(
Group(
:ExperimentID, :Read Date, :Experiment Type, :Plate Size, :Plate Type,
:Dispense Mode, :Probook Number, :Probook Page Number, :Experiment Notes
),
Freq( "None" ),
Weight( "None" ),
output table name("Experiment_summary")
);
experiment_summary = Data Table ("Experiment_summary");
experiment_id = "ExperimentID";
);
//Get Compounds Summary
getcompoundssummary = Function( {},
original_data << Summary(
Group(
:CompoundID, :Compound, :Compound Lot Number, :Compound Supplier, :Compound Catalog Number
),
Freq( "None" ),
Weight( "None" ),
output table name("Compound_summary")
);
compound_summary = Data Table ("Compound_summary");
Compound_ID = "CompoundID";
);
このようなものをお探しですか?
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
get_summary = function({dt, collist}, {Default Local},
dt_summary = dt << Summary(
Group(Eval(collist)),
Freq("None"),
Weight("None"),
Link to original data table(0),
output table name((dt << get name) ||" Summary")
);
return(dt_summary);
);
dt_summary1 = get_summary(dt, {"sex"});
dt_summary2 = get_summary(dt, {"sex", "age"});