Hi All
I am new to R/ Red-R and was just having a look at the tool to try and understand if it can help me do what I wish to do.
SOme issues which I came across were (for which I couldn't find answers are like):
- is there a widget to summarize a data set: widget equivalent for proc summary (sas); summarize/ aggregate in R
- is there a way to merge - multiple by conditions in merge widget; where clause on a variables etc. Present merge widget allows only 1 by condition?
- or something equivalent to sql query widget (if any)
I know the questions seem very simple but I just was not able to find the equivalent stuff and hence the query? And please note that the questions are more to ask if it is possible through present widgets rather than a 'How to' in caes of NO.
(if you have time you can definitely answer the 'how to' :) more info the better also but I will be thankful to even have a yes and a way to do in such a case)
Thanks
You can use the View R Object
You can use the View R Object widget to actually see the data and optionally a string representation of the data. I think there is also a widget named Summary which performs the R summary() function on the received object.
To perform multiple merges you would have to actually use many merge widgets and serially merge the data together. The R merge() function only allows two datasets, so we are limited to that.
You might have a look at the RedR SQLite package (get from Package Manager, the icon that looks like a box). This allows both controlled and advanced (un-limited) queries to SQLite databases. That might be useful if you have your data in a database already or want to put your data there.
There is this interesting package that proposes to allow sql queries on data frames from R. This could be wrapped into Red-R rather easily if there is enough community support for such an idea.
Kyle
Thanks... - i looked into the
Thanks...
- i looked into the summary() but had the impression that it wasnt outputting as a dataset. probably once i read more on R will get a way around this. I have SAS background so somehow thinking process go in that direction!!!
- BY multiple merge - I meant multiple 'by' condition/ where clause type conditions. I have seen such examples in R but in red-r when I am merging i get to choose only 1 by condition - hence the question
- Yes I am aware of sqldf -> and will be looking into the same
Thanks
Welcome
It's true that summary doesn't output a dataset, just text of the summary.
In my own work, it might be worth while to have some of the functions in sqldf so I'll look into implementing it. Specifically, I'm looking for a way to aggregate data in a column grouped by some other column. It just seems that this will require a lot of typing on my part to make these queries for what perhaps there is some easier way;
data::
c1 c2 c3 c4
a 10 30 10
a 15 12 9
b 89 78 10
select average(c2) average(c3) average(c4) from data group by c1
would be nice if there were just one call like average(c2:c4)...