cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
lwx228
Level VIII

How can I paste a data table with text mixed in the clipboard into the specified table?



 The clipboard has copied the R square table in the decision tree report, 6 rows and 6 columns, containing text. How can I paste this table into the new table?
thank you!

 



 

 



 

  RSquare RMSE N Number of Splits AICc
Training 0.502 2.5656293 3625 20 17162.6
Validation -0.77 4.6256646 3625
Test -0.70 4.3112172 3635 

 

 

2018-09-15_16-04-45.png



 

3 ACCEPTED SOLUTIONS

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

You need to start reading some of the basics. Every computer language has its own syntax.

 

Names Default to Here(1);

dt = Open("$sample_data/Boston Housing.JMP");

dt << Make Validation Column(
	Training Set( 0.50 ),
	Validation Set( 0.25 ),
	Test Set( 0.25 ),
	Formula Random
);

cart = dt<< Partition(
	Y( :mvalue ),
	X(
		:crim,
		:zn,
		:indus,
		:chas,
		:nox,
		:rooms,
		:age,
		:distance,
		:radial,
		:tax,
		:pt,
		:b,
		:lstat
	),
	Validation( :Validation ),
	Show Tree( 0 ),
	Split History( 1 ),
	Informative Missing( 1 ),
	Initial Splits(
		:lstat >= 7.79,
		{:distance < 2.0788, {:nox >= 0.609, {:lstat >= 17.21, {:crim >= 10.8342, {},
		{:nox < 0.74}}}}, {:lstat >= 14.8, {:crim >= 0.75026, {:b < 375.87}, {:tax
		 >= 304}}, {:rooms < 6.726, {:rooms < 6.101, {}, {:tax >= 422, {}, {:lstat
		 >= 11.98, {}, {:crim < 0.11425, {:rooms < 6.405}}}}}}}},
		{:lstat >= 4.32, {:rooms < 6.8, {:rooms < 6.546, {:distance >= 4.4986,
		{:indus < 5.64, {}, {:lstat >= 6.15}}}}, {:rooms < 7.52}}, {:b >= 392.83,
		{:rooms < 7.61}, {:indus < 18.1}}}
	),
	SendToReport(
		Dispatch( {}, "Partition Report", FrameBox, {Frame Size( 480, 218 )} )
	)
);

rsq_dt = report(Cart)[TableBox(1)] << Make into Data Table;

//create a table with extra rows and extra columns
_xx=New Table("result", New Column("d1"), New Column("d2"), New Column("d3"), New Column("d4"),
      New Column("Type", Character), New Column("RSQ"),
	  new Column("RMSE"), New Column("N"), New Column ("nsplits"),
	  new column("AICc"),
	  add rows(100)
);

nr = nrow(rsq_dt);
nc = ncol(rsq_dt);
cb=5;  ce=cb + nc -1;  //Column 5 is wher I want to paste it
rb=50; re=rb + nr -1;
//if rb> nrow(_xx) or ce>ncol(_xx) or the column data types do not match the next line will throw an error.
//it is up to the scripter to do error checking _xx[rb::re, cb::ce] = rsq_dt[1::nr, 1::nc]; close(rsq_dt, NoSave); current data table(_xx); _xx << bring window to front; _xx << go to row(rb); _xx << next selected;

View solution in original post

lwx228
Level VIII

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

Thank you for every expert help!
My JSL foundation is really poor. As I just got a one-month trial of the professional JMP version recently, I am in a hurry to use JSL to make multiple file decision tree calculations, and the process is automatic.Therefore, I could not learn slowly by myself and could only consult experts.

View solution in original post

txnelson
Super User

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

You can always create a JMP data table from the R Square table you are referencing, and then save that table as a csv or txt or slsx file. to then be read into your VBA script.

Jim

View solution in original post

14 REPLIES 14
lwx228
Level VIII

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

2018-08-23_21-30-06.png

lwx228
Level VIII

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

It is required to be done with JSL.Thank you!
gzmorgan0
Super User (Alumni)

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

The first column of the table you copied contains the group names "Training", "Validation", "Test", text.  You are trying to paste it into a column that is numeric, not a string. Note the dot a symbol represents an empty numeric column.

 

JMP maintains data types for the entire column.  JMP tables are like database tables, you do not find a person's name isn some row of a column that is expected to be their phone number.  Excel, Statistica, old RS/1 are display tables. They allow the preamble of the US constitution in cell A1 and today's temperature in cell A2.

 

Note, if you want to make a table of many "like" tables, for example many partitions, select Make Combined Data Table, it will create one table of all partition Summary of Fit tables.  

lwx228
Level VIII

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

Complete with this description:
I have copied the R side report of the decision tree to the clipboard with JSL provided by Jim.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Boston Housing.jmp" );
pp = dt << Partition(
Y( :mvalue ),
X(
:crim,
:zn,
:indus,
:chas,
:nox,
:rooms,
:age,
:distance,
:radial,
:tax,
:pt,
:b,
:lstat
),
Split Best( 3 )
);

Report( pp )[Table Box( 1 )] << copy data;



I tried many ways to paste the contents of the clipboard into the specified table without success.

text = Get Clipboard();
dt[7496,11]= Get Clipboard();


Please kindly advise.thank you!
gzmorgan0
Super User (Alumni)

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

You need to start reading some of the basics. Every computer language has its own syntax.

 

Names Default to Here(1);

dt = Open("$sample_data/Boston Housing.JMP");

dt << Make Validation Column(
	Training Set( 0.50 ),
	Validation Set( 0.25 ),
	Test Set( 0.25 ),
	Formula Random
);

cart = dt<< Partition(
	Y( :mvalue ),
	X(
		:crim,
		:zn,
		:indus,
		:chas,
		:nox,
		:rooms,
		:age,
		:distance,
		:radial,
		:tax,
		:pt,
		:b,
		:lstat
	),
	Validation( :Validation ),
	Show Tree( 0 ),
	Split History( 1 ),
	Informative Missing( 1 ),
	Initial Splits(
		:lstat >= 7.79,
		{:distance < 2.0788, {:nox >= 0.609, {:lstat >= 17.21, {:crim >= 10.8342, {},
		{:nox < 0.74}}}}, {:lstat >= 14.8, {:crim >= 0.75026, {:b < 375.87}, {:tax
		 >= 304}}, {:rooms < 6.726, {:rooms < 6.101, {}, {:tax >= 422, {}, {:lstat
		 >= 11.98, {}, {:crim < 0.11425, {:rooms < 6.405}}}}}}}},
		{:lstat >= 4.32, {:rooms < 6.8, {:rooms < 6.546, {:distance >= 4.4986,
		{:indus < 5.64, {}, {:lstat >= 6.15}}}}, {:rooms < 7.52}}, {:b >= 392.83,
		{:rooms < 7.61}, {:indus < 18.1}}}
	),
	SendToReport(
		Dispatch( {}, "Partition Report", FrameBox, {Frame Size( 480, 218 )} )
	)
);

rsq_dt = report(Cart)[TableBox(1)] << Make into Data Table;

//create a table with extra rows and extra columns
_xx=New Table("result", New Column("d1"), New Column("d2"), New Column("d3"), New Column("d4"),
      New Column("Type", Character), New Column("RSQ"),
	  new Column("RMSE"), New Column("N"), New Column ("nsplits"),
	  new column("AICc"),
	  add rows(100)
);

nr = nrow(rsq_dt);
nc = ncol(rsq_dt);
cb=5;  ce=cb + nc -1;  //Column 5 is wher I want to paste it
rb=50; re=rb + nr -1;
//if rb> nrow(_xx) or ce>ncol(_xx) or the column data types do not match the next line will throw an error.
//it is up to the scripter to do error checking _xx[rb::re, cb::ce] = rsq_dt[1::nr, 1::nc]; close(rsq_dt, NoSave); current data table(_xx); _xx << bring window to front; _xx << go to row(rb); _xx << next selected;
lwx228
Level VIII

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

Thank you for every expert help!
My JSL foundation is really poor. As I just got a one-month trial of the professional JMP version recently, I am in a hurry to use JSL to make multiple file decision tree calculations, and the process is automatic.Therefore, I could not learn slowly by myself and could only consult experts.
lwx228
Level VIII

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

Thank gzmorgan0! I learned a lot from this example.

 

 

In the syntax, the row and column requirements of JSL are consistent with those of VBA.

But VBA's       …… Cells(2, "").Resize(UBound(br), 1) = br  ……    are more flexible.

 

 

2018-09-16_07-33-03.png

txnelson
Super User

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

Within the JMP application, copying and pasting a data table typically would not be the method that would be used to move the data table contents.

Would you please explain what application etc. you are attempting to paste the clipboard into.

Jim
lwx228
Level VIII

Re: How can I paste a data table with text mixed in the clipboard into the specified table?

I loop each file according to different segmentation times, the minimum number of segmentation, different validation columns and different Y factors, and each file produces 200 results.


These results are saved as excel files and further calculated with VBA to obtain the results that meet the requirements.

Using VBA to process the results, I am skilled and more flexible, but the decision tree operation can only use JMP: JMP is fast.

Since there is no r-square control in my decision tree JSL code, I also want to get the relevant r-squared data in the decision tree report.
I was thinking that if I can't paste the r-square table, I just need 3 of them.

thank you!