레벨: 초보자
Mike Muhlada, JMP 개발 테스터, SAS
Audrey Shull, JMP 수석 개발 테스트 관리자, SAS
이 소개 데모에서는 수식 편집기 메커니즘을 설명하고, 일반적인 오류를 조사하고 수정하며, 수식 생성을 위한 모범 사례와 유용한 '트릭'을 확립하기 위해 예를 사용합니다. 자세한 연습에서는 드래그 앤 드롭, 키보드 단축키 및 함수 버튼을 사용하여 수식을 만드는 방법을 포함하여 수식 작성기의 다양한 측면을 다룹니다. 예제를 진행하면서 유용한 함수에 대해 논의하고, 일반적인 실수를 발견하고 수정하는 등의 작업을 수행합니다. 다룰 모범 사례 주제에는 사용자 정의 형식, 데이터 '정리'를 위한 수식 사용, 열 변환, 문자열 조작, JMP 날짜 함수 및 중간 열을 사용하여 보다 복잡한 수식을 작성하는 것이 포함됩니다. 사용자 정의 함수, 결과 미리보기, '실시간' 수식 오류/경고 감지 및 사용자 정의 가능한 함수 목록을 포함한 JMP 14의 새로운 기능에 특히 중점을 둡니다.
// custom function
funcDef=function( {height, weight},
{Default Local},
(weight * 0.45) / (height * 0.025) ^ 2
);
description="This function calculates BMI, given a person's weight and height. Weight is presumed to be in pounds and Height is presumed to be in inches. The conversion to metric is done inside the function itself.";
// Examples can be multiple statements inside expr()
ex2=expr(
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
custom:BMI(:height[4], :weight[4])
);
parmHint1="Height in inches";
parmHint2="Weight in pounds";
//create function using variables
bmi_=New Custom Function("custom", "BMI", funcDef);
bmi_ << Description(description);
bmi_ << Prototype("custom:BMI(height,weight)");
bmi_ << Example("custom:BMI(72,225)");
// expr() Examples need to be passed inside NameExpr()
bmi_ << Example(NameExpr(ex2));
bmi_ << Parameter("Number", parmHint1);
bmi_ << Parameter("Number", parmHint2);
bmi_ << Formula Category( "Discovery" );
bmi_ << Scripting Index Category( "Frankfurt Functions" );
//add myNamespace:AddTen function to system
Add Custom Functions(bmi_);