Hi Kyle and Anup,
I think we need some recipes, examples and tutorials so new comers will be interested try Red-R and get them excited, then community will grow.
We probably need tutorials how to make widgets with the r packages. I know there is a video on widget maker, I rather have a written tutorial and screenshots so we can
ggplot2 in rpy2 would probably good example for the creating a widget maker tutorial since there is alredy a python code.
http://rpy.sourceforge.net/rpy2/doc-2.1/html/graphics.html
Please see the lm model from the above link.
~~~~~~~~~~~~~~~~
Models fitted to the data are also easy to add to a plot:
pp = gp + \
ggplot2.aes_string(x='wt', y='mpg') + \
ggplot2.geom_point() + \
ggplot2.stat_smooth(method = 'lm')
pp.plot()
~~~~~~~~~~~
Thanks, Noli
For developers a cookbook is a good idea and I will probably start that on the developer documentation page soon.
I still don't understand how cookbooks and recipes fit in to using Red-R as a general user. If you could implement this in Red-R and show me the changes that you make I think I would consider adopting them.
Red-R once derived from Orange and some of the code is still the same. Many changes occured when moving to R signal classes. We have also made changes to almost every aspect of the canvas to better suit our own needs. That said python is python so you can not only cut and paste from orange but any other python resource you find when making your widget.
Kyle
Re:cookbook and recipe,
You know already the cookbook. It seems template is a cookbook and recipe is temple with data.
You can read the discussion about cookbook and recipe, here.
http://lists.osgeo.org/pipermail/qgis-developer/2010-May/009781.html
Re: Orange development page, I am just referring if the knowledge you learn in reading the orange documentation can be applied to Red-R widget development.
Another FAQ, How does Orange differs from Red-R? Can you copy some codes in orange widget code and use it in Red-R widget, then edit and modify to suit Red-R widget?
Noli
No. That's not the right thing to do. If you want to change cor.py you can do so in a text editor or even in the python text editor. If you want to run cor.py you can do so by loading it in the canvas of red-r using it's widget icon in the toolbar (Correlation I think it is). cor.py can't do anything by itself and nothing will happen if you try to open it.
I think it was made using widget maker. You could remake it using widget maker with package stats and function cor. Then you can look at the code in widget maker.
This is the universe of functionality for a red-r widget. They must be used in Red-R. The .py files can't work outside of red-r, they won't be imported properly, none of the accessory functions will be initialized, there will be nothing to handle signals, no GUI framework will exist or be imported, the redRGUI module will be meaningless and empty.
To use a widget (at the moment) you must do so with Red-R open and loading it in the canvas.
Feel free to change the code. Errors are output to the Output window so you can see things that you break. Give it a try by putting the code "print 'Hello world'" somewhere and try to call that function (__init__ is a favorite). You should see the text "Hello world" somewhere in the output (set your verbosity to high and debug mode to see this).
Kyle
OK. I don't worry about getting the latest code right now. I get Toitoise svn later on.
My 3G mobile internet broadband is very limited. I am trying to avoid download. It is very low byte left.
I went to the documentation page and it seems I done the 2 steps.
1. OPEN red-RCanvas.pyw python IDE in ./Red-R.x.xx/canvas and RUN to launch Red-R
2. OPEN cor.py in a python IDE in ./Red-R.x.xx/libraries/stats/widgets/
Now, my question how this codes cor.py is being generated. Is produced by Widget Marker?
Is this discuss in the video tutorial? I have to find a good free wireless connection to view those video.
Noli
I use tortise svn http://tortoisesvn.tigris.org/. it works great. no conflicts at all. You can go to the google.code repository here
Kyle
Hey Noli, could you tell me more what you mean by recipes? The documentation you pointed me to in orange is developer documentation. You can't actually copy or paste any of that code into a working version of orange for analysis. Rather the code shows you how to make widgets for orange.
We are working on developer documentation and much of the API is documented in the development section of the website. We still need to put more documentation (what documentation is truly complete). But even if we have these code examples in the documentation you wouldn't be able to enter them into the Red-R canvas (or if you could why you would want to).
Kyle
Hi Kyle,
OK. no scripting in Red-R, then applies to the widget copy and pasting between the project and template/recipe.
Yes, I am really interested to help on this project. I think we can get more people if you can get the more documentation. We can announce it in the R users mailing lists.
Now, I find it difficult to get the SVN source code. It seems that newer google.code project is using Hg.
Here is how to migrate svn to hg.
Convert your project from Subversion to Mercurial
I even tried using this svn plugin in hg. It is not working in google.
http://abdullin.com/journal/2010/3/22/use-tortoisehg-mercurial-with-svn-repository.html
Noli
I'm still not really understanding the copy and paste ideas that you have. Red-R isn't a scripting interface. If you wanted to copy and paste something you could do that in a widget and even execute the code in R or python or sqlite or any other software that we could find bindings for. Perhaps what you would want is a widget that does this...
Glad to see that you are interested in making widgets. You should start with widget maker and the developer documentation if the function is in R. Just follow the widget maker tutorial and see how it works out.
If you have any problems let me know. When you have the widgets working like you want them I can put up your package (if the system isn't on the website by then). You can also put any templates that you think might be useful as well as examples, documentation, screencasts, and "recipes" that you would like together and I'll put it on the site.
Thanks
Kyle
Reading this Getting started with widget development page.
It seems this Red-R Widget cookbook
https://red-r.org/development/getting-started-with-widget-development
It needs recipe as well for Red-R Widget development.
I wonder how this page compliments to the Red-R Getting started with widget development.
http://www.ailab.si/orange/doc/widgets/
Going back to Red-R IDE comments, I think if Red-R implemented the tabs similar to new version Orange, treeview can be use for projects, templates, recipes, demos, examples,etc. Then it is easy to cut and paste from the template/recipes to your current project.
The treeview UI would be like this.
~~~~~~~
+ projejects
+ templates
+ recipes
+ demos
+ scripts <--- Red-R have scripts?
~~~~~~~~~~
- projects
- Gene splicing
- Carbon model
+ templates
+ recipes
+ demos
+ scripts
A project inspector box / pane is good a well, similar to Delphi and Lazarus IDE.
These are just all suggestions.
Kyle, I am also interested in creating widget for R package. I like to have sample code for creating widgets. I probably start with a simple regression packages. I like the ggplot with regression.
http://had.co.nz/ggplot2/book.pdf
http://cran.r-project.org/src/contrib/Archive/ggplot/
Noli
I don't know if orange uses R packages or not.
We will try to implement these suggestions. Keep the comments coming.
Kyle
Hi Kyle,
Thanks for taking my suggestion positively.
As I read it, it seems that Red-R needs a FAQ section
Some of questions, for example are:
What is Red-R and Visual Programming?
This could be part of the answer.
"...make connections between widgets, what legal connections are, and how to use widgets in general. I envision each widget as being a small machine (like a gear in a car) that does some work. That work might be small and even non-functional by itself. Then by combining many of these small machines we can make larger machines that do really interesting things. I see templates as being those larger machines."
Yes, I think we need a tab for examples, most of the developers refer them now as Recipes as a result of the Cookbook.
A cookbook example: pyqgis cookbook.
http://www.mapserver.sk/~wonder/qgis/html/
I am planning to use Red-R for Forestry Carbon Modelling. I will elaborate later on.
Kyle, another thing, it seems Orange is moving those widgets in tabs. I just saw the latest orange screenshot. I think it is very logical since it becoming harder to use those widgets in treeview if you have a lot of widgets for example 100 or more widgets. In case of R package probably more.
Have a look at the "Performance scoring (classification)" screenshot
http://www.ailab.si/orange/screenshots.psp
I think Red-R should probably consider adopting the Delphi / Lazarus Free Pascal IDE layout of the tab - tab group same as Orange but retain the treeview for other purposes.
http://wiki.lazarus.freepascal.org/Image:Windows_2000.png
http://wiki.lazarus.freepascal.org/Screenshots
BTW, orange uses R packages?
Noli
I looked at the link for the spatial package. We should be able to recreate some of those things in Red-R, it's just a matter of setting up the right widgets and plot attributes. I can work on some of this but there are a lot of other packages that I need to get to for my own research.
Would anyone else be interested in making these packages.
I'd be happy to provide any help I can. It will also help us to make the developer documentation by our answering questions.
Kyle
Thanks for the link Noli. Hope I didn't sound offended in the last post. We do really need to work on documentation.
I looked at the Quick-R link, which seems to be a very good resource for getting R code. Thanks for posting it.
I think the example, template, documentation section is still evolving. We aren't really sure of what the best way will be to get information to users on how to use Red-R. We don't even know how Red-R users are using Red-R (and when I have talked with them the answers vary remarkably!!! not just in the analysis but in the way that it is being used).
For me the main goal is to show the users how to make connections between widgets, what legal connections are, and how to use widgets in general. I envision each widget as being a small machine (like a gear in a car) that does some work. That work might be small and even non-functional by itself. Then by combining many of these small machines we can make larger machines that do really interesting things. I see templates as being those larger machines.
So perhaps the templates are more like the recipes that you were talking about. If you want to use R example data then you could just call the data using RExecutor and send the data out. Or we could make a "data()" widget that does the same thing.
Perhaps we should include a tab called examples that has data embedded in it. I'm thinking of putting up very large templates for educational purposes that have either example or real data in them so users can see what can be done in Red-R and how to do it.
We are trying to open the template submission section up to the community so we can have many examples up for people to look at.
If anyone wants to show analysis as a template feel free to send it to me or Anup ().
What does the community think? If you were trying to learn Red-R how would you like to learn it?
I edited my last posting to address your concern about the data confidentiality. We don't need data for the examples. There are a lot of data in the R packages already. I found out when I am trying to learn R.
Please visit the websites mentioned in my last posting above. We can convert the data to various data format e.g CSV using foreign r packages and other r package data converter - rgdal can do csv to sqlite, etc.
The templates are for repeated use, like a machine that can be deployed over and over. They also make nice examples too. More could be done to add complex examples of data analysis. The problem is when you work with real data that it can private so not many people want to give live data examples.
Orange didn't have templates when we split. They may have added.
I think the templates have no data. I looked at the sqlite template. It has no data. Are the some of the templates have data in it? End-to-end demonstration how to use Red-R is needed. I think the examples screenshots in home pages - flashing screenshots could be the examples
The template is really good but the examples are better. Regarding the data, there a lot of data included in the R packages.
See these examples, it has data. Could we replicate this gallery in Red-R.
http://r-spatial.sourceforge.net/gallery/
Have a look at this site - Quick R
http://www.statmethods.net/graphs/bar.html
I think Quick R is easier to follow and use than Red-R at the moment. I can cut and paste the code and searching the data in R packages and use it in R terminal and see the results of the analysis and graphs. Red-R real examples and demos.
Is Orange got some examples and demos or just templates similar Red-R templates?
http://www.ailab.si/orange/doc/
Red-R website need more visual illustrations and code snippets. The widget maker documentation is all text. I really think it needs visual illustration - screenshots and code snippets if applicable in every paragraph
Again, look at this page - got code snippets in it
http://www.statmethods.net/input/importingdata.html
Red-R should have screenshots or diagrams instead of code snippets to reinforce and visualise what is being discussed.
Please don't take these comments personally. I really like that every people who visited the site can see what the software can offer without reading but just browsing it and get the idea and then register.
Noli
I just added some documentation for widget maker that explains the screencast. We are using rpy, not rpy2, so the development is much different.
Look in templates on the main site.