Closed gaocegege closed 7 years ago
So excited :D!
Can P.R run under Windows? If it doesn't, would it be possible in the future?
Kf
I haven't test now. I will have a try today or tomorrow :smile:
@gaocegege Let me know if you want me to give it a try from my side. I am not sure what file I should get. I have R and P3.3.5 already on my machine and I am looking forward to go through the steps to get the mode running in my Win10 machine.
Kf
Hi, kf
I have tried to run 2D sketches in Win 10 Virtual Machine. It works. I haven't tried 3D and libraries since my machine could not hold a windows VM for long time.
If you want to have a try, download the releases/download/v1.0.4-alpha/RLangMode.tar.gz from release page and put the mode into c://users/<users>/Documens/Processing/modes
.
Could I download a branch from git. I don't have access to tar.gz files in Win10.
Kf
The code in the repo is just source code, the mode in release page is the output, so downloading the branch doesn't works.
Does zip works for you? I have uploaded a zip file with same content: https://github.com/gaocegege/Processing.R/releases/download/v1.0.4-alpha/RLangMode.zip
Thank you. The zip worked. I got the R mode running but I cannot get it to run. I use the example above and I removed all references to peasycam just to keep it simple.
Kf
peasycam is in Library's example, you could have a try in Basics's example, for example, https://github.com/gaocegege/Processing.R/blob/master/examples/Basics/BasicOperations/BasicOperations.rpde
Hmmm... Nothing happens... no sketch, no error trace... I can try more tomorrow.
Kf
:thinking:
Yeah, P.R now doesn't output errors in PDE console, I will have a try when I return home tonight. My machine's memory here is only 4GB :smile:
It is weird but I think it is not a complex bug.
I don't meet any problem 🤔 Maybe you could start from a simple sketch: line(0,10,10,0)
or something else.
@gaocegege Really odd. Nothing even using simple line examples. Let me ask, do I need to setup R in any way?
No, R is just a java dependency in the mode, so it is built-in. Could I get your Version of Processing?
P3.3.5 64bit
It is same as mine. Could you start PDE in console and set an environment variable VERBOSE_RLANG_MODE=true
:
VERBOSE_RLANG_MODE=true <PATH_TO_PDE>
It will output the logs of Processing.R in the console.
So this is what I did. Starting at the processing.exe location, I issued: set VERBOSE_RLANG_MODE=true
and then I started processing from the command prompt. Nothing happened. This is what I issued:
processing-java --sketch=%cd%/sketch_170715a --run
Now from what I know, the sketch name in the previous line corresponds to the name of the folder. The name of the file has an extension rpde so I encountered this next error:
Not a valid sketch folder. C:\Users\C\AppData\Local\Temp\untitled6502517713539763193sketches\sketch_170715a\sketch_170715a.pde does not exist.
I am thinking maybe you want me to do something else? Or am I missing something, as for example, how to handle rpde files via command prompt.
Kf
Hi, it is my mistake. I want to get the log of PDE, and I tried to follow the code https://github.com/processing/processing/blob/processing-0262-3.3.5/app/src/processing/app/Base.java#L153 add a debug.txt
in APPDATA/roaming/processing, but it doesn't work. Then setting VERBOSE_RLANG_MODE will not work.
processing-java could not run rpde, only PDE's R mode could. I am trying to make Processing in Windows output logs for PDE. It will take me a few days.
My PDE is clean and does not have any other mode or library, maybe you could back up the libraries and modes, then make a clean environment and have another try :thinking:
Sorry for the bad experience with Processing.R in Windows, again :pray: If I know how to output logs for PDE in Windows, I will let you know.
So I remove my sketch folder and removed the preferences folder (renamed them) and then I ran processing and allowed it to create the default folders. I closed it and then I moved the R mode right into the modes folder. I created the debug.txt file in the new preference folder and run Processing in R mode and all the same. I am thinking the debugging option needs to be enabled:
/**
- True if heavy debugging error/log messages are enabled. Set to true
- if an empty file named 'debug' is found in the settings folder.
- See implementation in createAndShowGUI(). */
On a side note, you said:
My PDE is clean and does not have any other mode or library
Just to clarify, you have the java mode still available there, right?
Kf
Yeah, java is built-in and available in my Windows environment
I have a Windows laptop now and it works well 🤔
Great! @kfrajer, please try again with the latest release -- or wait a few days and it will be available in PDE > Contributions Manager > Modes.
@gaocegege @jeremydouglass I confirmed the R mode works in my machine. See below.
I also ran the provided example RPackageBasics.rpde and it took a while to execute because it was downloading the library. I have R in my computer. Is it possible to tell the R mode to check my current installed libraries under my R stand-alone version? It would be great to have a single pool for the libraries. It is not a deal breaker, and it is really not that important... it is more of a thought.
Now I am interested to see more about how I can integrate R and P3 together. Do you have more examples available? Is there more examples available in the R Mode's reference?
Kf
It is good news. There are lots of examples available in `File -> Examples
Great news, @kfrajer. If you have ideas and feedback about types of R integration, please share them!
Great to see the examples. For some reason I just checked the one that was related to R. I will check them out and see if I can contribute with an example or two.
Cheers,
Kf
Hi, Kf
The examples in reference are migrated from Processing reference, so if you'd like to contribute you could see wiki about how to document Processing.R.
Thank you for trying :smiley:
The mode has been released in PDE, so I think it is time to close it.
@gaocegege I was going to remind you to also update the readme... but you already did it!
@kfrajer, definitely let us know by pull request or in the forum if you want to contribute any example sketches.
Processing.R has released 5 versions. You can get the latest mode from Release Page.
After you download the mode, place it into Processing "modes" directory:
${HOME}/Documents/Processing/modes
${HOME}/sketchbook/modes
C:\Users\<user>\Documents\Processing\modes
Now the features in Processing.R include:
Built-in functions in Processing
The documentation website is https://processing-r.github.io/Processing.R-docs/. This documentation is currently incomplete. Most Processing functions are theoretically supported in Processing.R, but many functions have not been tested and some pages have not been edited yet to reflect differences from other Processing modes.
Libraries in Processing:
importLibrary()
Processing.R supports importing standard Processing(Java) libraries that enrich the functionality of Processing. The function
importLibrary()
imports new libraries manually. This has been tested with one library: peasycam, the "dead-simple mouse-driven camera for Processing."Before trying the example code below, first install the corresponding library
peasycam
-- for example using the PDE Contribution Manager > Library.R Packages:
library()
Processing.R has limited support for R packages. It will automatically download R packages that are requested using the
library()
function, so you can use packages directly.Here is an example using the
foreach
package:In practice we have only found a few R packages so far that work with Processing.R "out of the box." This is because the package must be pure R and all of its dependencies must also be pure R. There is renjin list of R packages which lists their compatibility with the renjin JVM. Any package fully supported in renjin is theoretically supported in Processing.R.
Limitations in Processing.R
Processing.R is in active development as an experimental pre-release version.
Static sketches: Processing.R does not have a good support for detecting static/active/mix mode. We recommend that all sketches be written in full active mode, defining a separate
settings
,setup
anddraw
. Even simple sketches should be wrapped indraw()
. For example, do not write:That may cause bugs. Instead, write:
Please try our experimental mode and give us your feedback :) If you want to contribute to this mode, there are issues for new contributors and the architecture documentation.
If you have any problem about the mode, come chat at the Processing.R gitter channel :tada: