<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JMP find R in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228814#M45388</link>
    <description>&lt;P&gt;You might need to run a R script to make sure that the data frame is available when you call R Get(). The example code for the R Get() opens a JMP data table called Big Class, sends it to R, then gets it back to JMP. Sending it to R made it an active data frame. What are you doing to make the data frame active in R?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is another example that might help, where a R script is run from JMP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

R Init();

R Submit(
	"x &amp;lt;- rnorm(1000)
hx &amp;lt;- hist(x, breaks=100, plot=FALSE)
plot(hx, col=ifelse(abs(hx$breaks) &amp;lt; 1.669, 4, 2))
x &amp;lt;- rnorm (100)
y &amp;lt;- x**2 + rnorm (100)
summary(y)"
);

Wait( 3 );

R Term();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might need something like this example to be sure that the R data frame is available.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2019 15:21:26 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2019-10-10T15:21:26Z</dc:date>
    <item>
      <title>JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228669#M45362</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Very much a novice-question here. I like to use JMP, and have some data in R that I'd like to import to JMP. I'm trying to use the JMP-to-R interface (first time scripting in JMP), and I don't really know what I'm doing. However, when I run the following JSL script, nothing happens;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test1 = Get R(test1);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm sure there's much more to it than this, but I'm really at a loss on how to proceed. If you have some suggestions for how I begin pulling data from R into JMP, I'd love to hear! I'm on a PC that just got upgraded to Windows 10, so something I was thinking (but have no idea if this is it) is that JMP can't find the location of my R installation. Again, this is my first venture into JSL scripting, so this is probably a beginner question, but I'm not really sure what I'm doing here. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 20:02:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228669#M45362</guid>
      <dc:creator>drewb</dc:creator>
      <dc:date>2019-10-09T20:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228682#M45366</link>
      <description>The first thing you should do is to read the section "Working with R" in the Scripting Guide section, Extending JMP&lt;BR /&gt;     Help==&amp;gt;Books==&amp;gt;Scripting Guide</description>
      <pubDate>Wed, 09 Oct 2019 20:22:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228682#M45366</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-10-09T20:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228790#M45379</link>
      <description>&lt;P&gt;I agree with Jim. There is a lot of information in the documentation that will save you much confusion and wasted time. Many of the examples provide a good starting point for your own scripts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, using R with JMP is not difficult. You must first call the &lt;STRONG&gt;R Connect()&lt;/STRONG&gt; function to start R and establish a connection. The other R functions, such as &lt;STRONG&gt;R Get()&lt;/STRONG&gt;, then work through this connection.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 13:53:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228790#M45379</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T13:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228801#M45384</link>
      <description>&lt;P&gt;Thank you for your suggestions, Mark &amp;amp; Jim. I took a look at the Scripting Guide again and, unfortunately, am still confused. I ran the "Test Your Setup" script that they provide in the Scripting Guide, and it appears to work fine (so my concern that JMP wasn't able to find R seems to be unfounded). However, when I try to run the following script to pull a test dataframe from the R environment (that I called "test1")..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;R Connect();
test1 = R Get(test1);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get the following output from the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TKIntRJMP.R version 5.05&lt;BR /&gt;Warning: Error in eval(expr, p) : object 'test1' not found&lt;BR /&gt;Unknown&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not really sure how to trouble-shoot this. I was unable to find a resolution in the Scripting Guide to this issue. Maybe my understanding of this is incorrect? My understanding was that the command R Get() would pull some object from R and return it in JMP. So if I had a dataframe created in the R environment, it would be pulled into JMP as a datatable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your advice!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 14:38:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228801#M45384</guid>
      <dc:creator>drewb</dc:creator>
      <dc:date>2019-10-10T14:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228812#M45386</link>
      <description>&lt;P&gt;What did you store in the variable named &lt;STRONG&gt;test1&lt;/STRONG&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 15:13:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228812#M45386</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T15:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228813#M45387</link>
      <description>&lt;P&gt;Here is a short example from the Help &amp;gt; Scripting Index that might help get you started:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

R Init();

x1 = [1, 2, 3];
R Send( x1 );
x2 = R Get( x1 );
Show( x1, x2 );

R Term();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I might have set you in the wrong direction with &lt;STRONG&gt;R Connect()&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 15:17:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228813#M45387</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T15:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228814#M45388</link>
      <description>&lt;P&gt;You might need to run a R script to make sure that the data frame is available when you call R Get(). The example code for the R Get() opens a JMP data table called Big Class, sends it to R, then gets it back to JMP. Sending it to R made it an active data frame. What are you doing to make the data frame active in R?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is another example that might help, where a R script is run from JMP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

R Init();

R Submit(
	"x &amp;lt;- rnorm(1000)
hx &amp;lt;- hist(x, breaks=100, plot=FALSE)
plot(hx, col=ifelse(abs(hx$breaks) &amp;lt; 1.669, 4, 2))
x &amp;lt;- rnorm (100)
y &amp;lt;- x**2 + rnorm (100)
summary(y)"
);

Wait( 3 );

R Term();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might need something like this example to be sure that the R data frame is available.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 15:21:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228814#M45388</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T15:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228816#M45390</link>
      <description>&lt;P&gt;Hmm, maybe my data.frame in R isn't available for JMP to access? I'm not sure why, though. When I ran an example script from JMP, it was able to access a dataframe.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;R Init();
R Submit(
"
L3 &amp;lt;- LETTERS[1:3]
d &amp;lt;- data.frame(cbind(x=1, y=1:15), Group=sample(L3, 15, repl=TRUE))
"
);
R Get( d ) &amp;lt;&amp;lt; NewDataView;
R Term();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I create a dataframe in R, however, it seems like JMP can't access it. My R script is as follows:&lt;/P&gt;&lt;P&gt;test1 &amp;lt;- data.frame("x"=c(1,2,3,4),"y"=c(5,6,7,8))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting data.frame is stored in the R "Global Environment", but when I try to access it with R Get(test1), it doesn't seem to recognize this.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 15:34:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228816#M45390</guid>
      <dc:creator>drewb</dc:creator>
      <dc:date>2019-10-10T15:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228832#M45391</link>
      <description>&lt;P&gt;Yes, I think that you have to submit the R code to make the data frame active in the session during the connection with JMP. This example creates a data frame 'from scratch' and stores it in variable d. The R Get() call can ask for it because it now exists in the R workspace. You might also open a file or get a data frame as a result of modeling in other cases, for example. The data frame does not exist in R unless you submit code to make it one way or another way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

R Init();

R Submit(
    "L3 &amp;lt;- LETTERS[1:3]
     d &amp;lt;- data.frame(cbind(x=1, y=1:15), Group=sample(L3, 15, repl=TRUE))"
);

dt = R Get( d ) &amp;lt;&amp;lt; New Data View;

R Term();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:17:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228832#M45391</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T16:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228833#M45392</link>
      <description>&lt;P&gt;How do you create the data frame in R? Why do you think that it exists in R when JMP connects to it?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:21:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228833#M45392</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T16:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228835#M45393</link>
      <description>&lt;P&gt;Hmm, maybe what I was wanting to do won't work in this instance?&lt;/P&gt;&lt;P&gt;I had a data.frame that was already in the R Global Environment (I/other people had worked on it in R), and I wanted to pull it into JMP. However, from my understanding of our conversation, I would need to run the entire R script in the JMP Script dialog box in order for JMP to "see" the data.frame. Is this correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or maybe there's another step I've missed here. If I've already created a data.frame in R (and it is now in the R 'Global Environment), it's still not visible to JMP. But can it become visible to JMP? In R, I've run the following command:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test1 &amp;lt;- data.frame("x"=c(1,2,3,4),"y"=c(5,6,7,8))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So now "test1" is in the R Global Environment. But for some reason JMP still can't "see" it? Maybe there's something I can do to make this data.frame visible to JMP without having to rerun the R script through the JMP Script dialog box?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:36:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228835#M45393</guid>
      <dc:creator>drewb</dc:creator>
      <dc:date>2019-10-10T16:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228840#M45394</link>
      <description>&lt;P&gt;I just tried using a connection but it did not fare any better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have never encountered this situation before. I have always sent what I need to R, run R scripts, returned what I want, and move on in JMP.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not convinced that it is not possible. I recomment that you contact JMP Technical Support (support@jmp.com) and ask them for help.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 17:34:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228840#M45394</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T17:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228853#M45395</link>
      <description>&lt;P&gt;Thanks for trying this out on your end, Mark! I'll reach out to Technical Support to see what they have to say on this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 18:00:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228853#M45395</guid>
      <dc:creator>drewb</dc:creator>
      <dc:date>2019-10-10T18:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228881#M45398</link>
      <description>&lt;P&gt;Please post their answer here. New territory!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 19:40:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/228881#M45398</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-10T19:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: JMP find R</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/229118#M45433</link>
      <description>&lt;P&gt;I spoke to JMP Support about this topic; unfortunately, a user isn't able to pull a dataframe from R into JMP the way I was enquiring. From JMP Support:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;JMP does not interact with R in this manner. When JMP initializes R, it starts a new session (environment). That session is completely isolated from R meaning, if you were to start a new R session, JMP would not recognize any of the environment variables (global or local). This is why your R data frame is unknown to JMP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There are a few ways to pull data from R into JMP, but they essentially all require that the dataframe in R is "created" by running a script through the JMP Scripting dialog box. I've been doing option #3 (having R write the dataframe to a csv file, and then opening the csv file with JMP), but option #2 is intriguing. When I tried, this, unfortunately, I ran out of memory on my computer, so this may not be a viable option for extremely large dataframes. These were the suggestions from JMP Support:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;1.	Use JMP's R Submit () to create the data frame. The use R Submit () and R Get () to bring the data frame into JMP. This is probably the mostly commonly used approach. 
 
2.	Use JMP's R Submit () to load the data frame via R and bring it back to JMP.
 
3.	Lastly, you can also save the data frame from R as a CSV and open it in JMP using JSL's open function. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 18:40:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-find-R/m-p/229118#M45433</guid>
      <dc:creator>drewb</dc:creator>
      <dc:date>2019-10-11T18:40:00Z</dc:date>
    </item>
  </channel>
</rss>

