cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-786162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%ED%8F%89%EA%B0%80%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%20%EB%B3%80%EC%88%98%EC%97%90%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%EC%A0%80%EC%9E%A5%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-786162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%EA%B7%9C%EB%AA%A8%EA%B0%80%20%ED%81%B0%20%EB%8C%80%EB%B3%B8%EC%9D%84%20%EC%9E%91%EC%97%85%ED%95%98%EB%A9%B4%EC%84%9C%20%ED%91%9C%EC%A0%95%EA%B3%BC%20%EA%B4%80%EB%A0%A8%EB%90%9C%20%EB%AA%87%20%EA%B0%80%EC%A7%80%20%ED%9D%A5%EB%AF%B8%EB%A1%9C%EC%9A%B4%20%ED%98%84%EC%83%81%EC%9D%84%20%EB%B0%9C%EA%B2%AC%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%EB%8B%A4%EC%9D%8C%EC%9D%98%20jsl%20%EC%BD%94%EB%93%9C%EB%A5%BC%20%EC%82%B4%ED%8E%B4%EB%B3%B4%EC%84%B8%EC%9A%94.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Create%20a%20namespace%20for%20cleanliness%3C%2FFONT%3E%0Ans%20%3D%20New%20Namespace(%22ns%22)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Make%20an%20example%20data%20table%20dt%3C%2FFONT%3E%0Ans%3Adt%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3ENew%20Table%3C%2FFONT%3E(%22window%22%2C%20%0A%09%09%09%09%3CFONT%20color%3D%22%233366FF%22%3ENew%20Column%3C%2FFONT%3E(%22a%22%2C%20set%20values(%5B1%2C2%2C3%5D))%2C%0A%09%09%09%09%3CFONT%20color%3D%22%233366FF%22%3ENew%20Column%3C%2FFONT%3E(%22b%22%2C%20set%20values(%5B1%2C4%2C9%5D))%0A)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%201.%20Make%20an%20expression%20gr_exp1%20containing%20the%20graph%20builder%20instructions%3C%2FFONT%3E%0Ans%3Agr_exp1%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20%3CFONT%20color%3D%22%230000FF%22%3EGraph%20Builder%3C%2FFONT%3E(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09%09%09%09)%3B%3CBR%20%2F%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Running%20the%20expression%20will%20build%20the%20graph%20(as%20expected)%0A%3CFONT%20color%3D%22%23000000%22%3Ens%3Agr_exp1%3B%3C%2FFONT%3E%3CBR%20%2F%3E%09%09%09%09%0A%2F%2F%202.%20Make%20a%20function%20f1%20that%20saves%20the%20graph%20builder%20instructions%20into%20an%20expression%20gr_exp2%3C%2FFONT%3E%0Ans%3Af1%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20%3CFONT%20color%3D%22%230000FF%22%3EGraph%20Builder%3C%2FFONT%3E(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)%3B%0A)%3B%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20When%20one%20runs%20the%20function%2C%20the%20graph%20will%20be%20displayed%2C%20though%20only%20saving%20the%20%3CBR%20%2F%3E%2F%2F%20expression%20into%20a%20variable%20is%20desired.%3C%2FFONT%3E%0Ans%3Af1%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%EC%9D%B4%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%97%90%EC%84%9C%EB%8A%94%20%EA%B7%B8%EB%9E%98%ED%94%84%EB%A5%BC%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9C%BC%EB%A1%9C%20%EC%A0%80%EC%9E%A5%ED%95%98%EA%B3%A0(%EB%82%98%EC%A4%91%EC%97%90%20%ED%8F%89%EA%B0%80%ED%95%98%EA%B3%A0)%20%EC%8B%B6%EC%97%88%EA%B8%B0%20%EB%95%8C%EB%AC%B8%EC%97%90%20%ED%8C%9D%EC%97%85%EC%9D%B4%20%EB%9C%A8%EB%8A%94%20%EA%B2%83%EC%9D%84%20%EC%9B%90%ED%95%98%EC%A7%80%20%EC%95%8A%EC%95%98%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EB%AA%87%20%EB%B2%88%EC%9D%98%20%EC%8B%9C%ED%96%89%EC%B0%A9%EC%98%A4%20%EB%81%9D%EC%97%90%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%EB%8B%A4%EB%A5%B8%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%97%90%20%EC%A4%91%EC%B2%A9%ED%95%98%EB%A9%B4%20%EB%AC%B8%EC%A0%9C%EA%B0%80%20%ED%95%B4%EA%B2%B0%EB%90%9C%EB%8B%A4%EB%8A%94%20%EA%B2%83%EC%9D%84%20%EC%95%8C%EA%B2%8C%20%EB%90%98%EC%97%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ens%3Af2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09))%3B%0A)%3B%3CBR%20%2F%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Now%20no%20graph%20is%20displayed%20when%20running%20the%20function%2C%20and%20the%20expression%20is%20saved!%3C%2FFONT%3E%3CBR%20%2F%3Ens%3Af2%3B%3CBR%20%2F%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%EA%B7%B8%EA%B2%8C%20%EC%A0%9C%20%EB%AC%B8%EC%A0%9C%EB%A5%BC%20%ED%95%B4%EA%B2%B0%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%ED%95%98%EC%A7%80%EB%A7%8C%20%EC%A0%9C%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%9D%98%20%EA%B5%AC%EC%A1%B0%EB%A5%BC%20%EA%B0%90%EC%95%88%ED%95%98%EB%A9%B4%2C%20%EC%8B%A4%EC%A0%9C%EB%A1%9C%EB%8A%94%20%EB%8B%A4%EB%A5%B8%20%ED%95%A8%EC%88%98%2C%20%EC%98%88%EB%A5%BC%20%EB%93%A4%EC%96%B4%20f3%EC%97%90%EC%84%9C%20%ED%95%A8%EC%88%98%20f2%EB%A5%BC%20%ED%98%B8%EC%B6%9C%ED%95%B4%EC%95%BC%20%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%204.%20Now%20make%20a%20function%20f3%20that%20calls%20f2%20(with%20the%20idea%20of%20simply%20saving%20an%20expression)%3C%2FFONT%3E%0Ans%3Af3%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Af2%3B%0A)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Running%20the%20script%20will%20produce%20a%20graph%20again...%3C%2FFONT%3E%0Ans%3Af3%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%EA%B7%B8%EB%9F%B0%20%EB%8B%A4%EC%9D%8C%20%ED%95%A8%EC%88%98%20f2%EB%A5%BC%20%EC%82%BC%EC%A4%91%20%EC%A4%91%EC%B2%A9%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9C%BC%EB%A1%9C%20%EC%88%98%EC%A0%95%ED%95%98%EB%A9%B4%20%EB%AC%B8%EC%A0%9C%EA%B0%80%20%ED%95%B4%EA%B2%B0%EB%90%9C%EB%8B%A4%EB%8A%94%20%EA%B2%83%EC%9D%84%20%EC%95%8C%EC%95%98%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%A6%89%2C%20%EA%B7%B8%EB%9E%98%ED%94%84%EB%A5%BC%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9C%BC%EB%A1%9C%20%EC%A0%80%EC%9E%A5%ED%95%98%EB%A9%B4%EC%84%9C%20%ED%8F%89%EA%B0%80%EB%8A%94%20%EC%96%B5%EC%A0%9C%ED%95%A9%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20This%20can%20be%20solved%20by%20modifying%20f2%3C%2FFONT%3E%20%0Ans%3Af2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Efunction%3C%2FFONT%3E(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(%3CFONT%20color%3D%22%233366FF%22%3Eexpr%3C%2FFONT%3E(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%3CLI-EMOJI%20id%3D%22lia_face-with-tongue%22%20title%3D%22%3Acara_con_la_lengua_fuera%3A%22%3E%3C%2FLI-EMOJI%3E%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)))%3B%0A)%3B%0A%0A%3CFONT%20color%3D%22%23339966%22%3E%2F%2F%20Running%20f3%20now%20acts%20as%20desired%20(saves%20expression%20and%20suppresses%20evaluation%20of%20graph)%3C%2FFONT%3E%0Ans%3Af3%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%EC%9D%B4%20%EB%AC%B8%EC%A0%9C%EB%A5%BC%20%ED%95%B4%EA%B2%B0%ED%95%98%EB%8A%94%20%EB%8D%B0%EB%8A%94%20%EC%84%B1%EA%B3%B5%ED%96%88%EC%A7%80%EB%A7%8C%2C%20%EC%A0%9C%20%EC%A7%88%EB%AC%B8%EC%9D%80%20%EB%8B%A4%EC%9D%8C%EA%B3%BC%20%EA%B0%99%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%ED%8F%89%EA%B0%80%20%3CSTRONG%3E%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%3C%2FSTRONG%3E%20%ED%98%B8%EC%B6%9C%20%EC%8B%9C%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%EB%B3%80%EC%88%98%EC%97%90%20%EC%A0%80%EC%9E%A5%ED%95%98%EB%8A%94%20%ED%95%A8%EC%88%98%EB%A5%BC%20(%EC%98%AC%EB%B0%94%EB%A5%B4%EA%B2%8C)%20%EB%A7%8C%EB%93%A4%EB%A0%A4%EB%A9%B4%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%ED%95%B4%EC%95%BC%20%ED%95%98%EB%82%98%EC%9A%94%3F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%EC%A0%80%EB%8A%94%20JMP%20Pro%2018.0%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EA%B3%A0%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EB%8F%84%EC%9B%80%EC%9D%B4%EB%82%98%20%EC%9D%98%EA%B2%AC%EC%9D%B4%20%EC%9E%88%EC%9C%BC%EB%A9%B4%20%EA%B0%90%EC%82%AC%ED%95%98%EA%B2%A0%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-786162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%EC%9E%90%EB%8F%99%ED%99%94%20%EB%B0%8F%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8C%85%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-786229%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20%ED%8F%89%EA%B0%80%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%20%EB%B3%80%EC%88%98%EC%97%90%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%EC%A0%80%EC%9E%A5%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-786229%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fexpression-functions.shtml%3Fos%3Dwin%26amp%3Bsource%3Dapplication%23ww4993368%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EName%20Expr()%EC%9D%80%3C%2FA%3E%20%EB%8B%B9%EC%8B%A0%EC%9D%B4%20%EC%B0%BE%EA%B3%A0%20%EC%9E%88%EB%8A%94%20%EC%98%B5%EC%85%98%20%EC%A4%91%20%ED%95%98%EB%82%98%EC%9D%BC%20%EC%88%98%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1724782668368.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67579i3595B743686DF801%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_0-1724782668368.png%22%20alt%3D%22jthi_0-1724782668368.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fadvanced-expressions-macros-and-lists.shtml%23ww339382%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fadvanced-expressions-macros-and-lists.shtml%23ww339382%3C%2FA%3E%20%EB%A5%BC%20%EC%9D%BD%EC%96%B4%EB%B3%B4%EB%A9%B4%20%EC%A2%8B%EC%9D%84%20%EB%93%AF%ED%95%A9%EB%8B%88%EB%8B%A4.%20%EB%98%90%ED%95%9C%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMPer-Cable%2FExpression-Handling-Functions-Part-I-Unraveling-the-Expr%2Fm-p%2F28963%23U28963%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-blog-thread%20lia-fa-icon%20lia-fa-blog%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3EExpression%20Handling%20Functions%3A%20Part%20I%20-%20Unraveling%20the%20Expr()%2C%20NameExpr()%2C%20Eval()%2C%20...%20Conundrum%3C%2FA%3E%20(%EC%A0%9C%EA%B0%80%20%EC%95%84%EB%8A%94%20%ED%95%9C%20part2%EB%8A%94%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-788120%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ERe%3A%20%ED%8F%89%EA%B0%80%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%20%EB%B3%80%EC%88%98%EC%97%90%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%EC%A0%80%EC%9E%A5%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-788120%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F38150%22%20target%3D%22_blank%22%3E%40ThomasB%3C%2FA%3E%20%2C%3C%2FP%3E%3CP%3E%ED%95%A8%EC%88%98%EC%9D%98%20%EB%A7%88%EC%A7%80%EB%A7%89%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%B4%20%EB%B0%98%ED%99%98%20%EA%B0%92%EC%9C%BC%EB%A1%9C%20%EC%82%AC%EC%9A%A9%EB%90%9C%EB%8B%A4%EB%8A%94%20%EC%A0%90%EC%97%90%20%EC%9C%A0%EC%9D%98%ED%95%98%EC%84%B8%EC%9A%94.%3CBR%20%2F%3E%20%22%EB%B0%98%ED%99%98%22%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%ED%95%A0%EB%8B%B9%ED%95%98%EB%A0%A4%EB%8A%94%20%EA%B2%BD%EC%9A%B0%20%EB%8D%94%EB%AF%B8%20%EB%B0%98%ED%99%98%20%EA%B0%92%EC%9D%84%20%EC%B6%94%EA%B0%80%ED%95%98%EC%84%B8%EC%9A%94.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ens%3Af1%20%3D%20function(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20expr(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)%3B%0A%091%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%EB%98%90%EB%8A%94%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ens%3Af1%20%3D%20function(%7B%7D%2C%7BDefault%20Local%7D%2C%0A%09ns%3Agr_exp2%20%3D%20expr(ns%3Agr%20%3D%20ns%3Adt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%09%09%09%09%09%09Show%20Control%20Panel(%200%20)%2C%0A%09%09%09%09%09%09Variables(%20X(%20%3Aa%20)%2C%20Y(%20%20)%20)%2C%0A%09%09%09%09%09%09Elements(%20Points(%20X%2C%20Y%2C%20Legend(%208%20)%20)%2C%20Smoother(%20X%2C%20Y%2C%20Legend(%209%20)%20)%20))%3B%0A%09)%3B%0A%09return(1)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-789644%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20%ED%8F%89%EA%B0%80%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%20%EB%B3%80%EC%88%98%EC%97%90%20%ED%91%9C%ED%98%84%EC%8B%9D%EC%9D%84%20%EC%A0%80%EC%9E%A5%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-789644%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%EB%8B%B5%EB%B3%80%EA%B3%BC%20%EB%A7%81%ED%81%AC%EB%A5%BC%20%EA%B3%B5%EC%9C%A0%ED%95%B4%20%EC%A3%BC%EC%85%94%EC%84%9C%20%EA%B0%90%EC%82%AC%ED%95%A9%EB%8B%88%EB%8B%A4%2C%20Jarmo.%20%EA%B7%B8%20%EB%A7%81%ED%81%AC%EB%8F%84%20%EB%A7%A4%EC%9A%B0%20%EB%8F%84%EC%9B%80%EC%9D%B4%20%EB%90%A9%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
ThomasB
Level II

how to save expressions in a variable without evaluating?

While working on a big script, I noticed some interesting behavior regarding expressions.

 

Consider the following piece of jsl code:

 

// Create a namespace for cleanliness
ns = New Namespace("ns");

// Make an example data table dt
ns:dt = New Table("window", 
				New Column("a", set values([1,2,3])),
				New Column("b", set values([1,4,9]))
);

// 1. Make an expression gr_exp1 containing the graph builder instructions
ns:gr_exp1 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
				);
// Running the expression will build the graph (as expected) ns:gr_exp1;
// 2. Make a function f1 that saves the graph builder instructions into an expression gr_exp2
ns:f1 = function({},{Default Local}, ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder( Show Control Panel( 0 ), Variables( X( :a ), Y( ) ), Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )); ); ); // When one runs the function, the graph will be displayed, though only saving the
// expression into a variable is desired.
ns:f1;

Since for this script I just wanted to save the graph as an expression (and evaluate later), I did not want it to pop-up. After some trial and error, I noticed that nesting the expression in another expression solved the problem:

 

ns:f2 = function({},{Default Local},
	ns:gr_exp2 = expr(expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	));
);
// Now no graph is displayed when running the function, and the expression is saved!
ns:f2;

That solved my issue. But, given the structure of my script, I actually needed to call the function f2 from another function, say f3:

// 4. Now make a function f3 that calls f2 (with the idea of simply saving an expression)
ns:f3 = function({},{Default Local},
	ns:f2;
);

// Running the script will produce a graph again...
ns:f3;

Then I noticed that modifying the function f2 to have a triple nested expression solved the issue - it saves the graph as an expression, while suppressing its evaluation:

// This can be solved by modifying f2 
ns:f2 = function({},{Default Local},
	ns:gr_exp2 = expr(expr(expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	)));
);

// Running f3 now acts as desired (saves expression and suppresses evaluation of graph)
ns:f3;

While I have managed to navigate through this issue, my question is:

 

How do I (correctly) make a function that, upon calling it, saves the expression into a variable without evaluating the expression? 

 

I'm using JMP Pro 18.0. Any help or comments are appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XII

Re: how to save expressions in a variable without evaluating?

Hi @ThomasB ,

please note that the last expression of a function is used as the return value.
If you just want to assign the expression without "returning" it, please add a dummy return value:

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	1;
);

or 

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	return(1);
);

 

 

View solution in original post

3 REPLIES 3
jthi
Super User

Re: how to save expressions in a variable without evaluating?

hogi
Level XII

Re: how to save expressions in a variable without evaluating?

Hi @ThomasB ,

please note that the last expression of a function is used as the return value.
If you just want to assign the expression without "returning" it, please add a dummy return value:

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	1;
);

or 

 

ns:f1 = function({},{Default Local},
	ns:gr_exp2 = expr(ns:gr = ns:dt << Graph Builder(
						Show Control Panel( 0 ),
						Variables( X( :a ), Y(  ) ),
						Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ));
	);
	return(1);
);

 

 

ThomasB
Level II

Re: how to save expressions in a variable without evaluating?

Thank you for your reply and the link, Jarmo, they are also very helpful.