Closed aalexandersson closed 8 years ago
please read the Rcall manual carefully. The reason is that the $ sign is preserved for Stata Globals and if you want to use it in Rcall you should put a backslash behind it. i.e.
R: rpairs\$pairs[1:5, ]
Also, Rcall can in theory return all R classes to Stata. At the moment, - as noted in the help file - it returns character, numeric, matrix, and list classes, and it has a function for returning dataframe. You should figure out to pass other classes by converting them to any of the available classes or update the program! ;)
BTW, this issue had nothing to do with MarkDoc package ;)
Sorry, it has been a long week. The backslash fixed the issue I had with Rcall.
On Fri, Jul 15, 2016 at 3:45 PM, E. F. Haghish notifications@github.com wrote:
Closed #10 https://github.com/haghish/MarkDoc/issues/10.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/haghish/MarkDoc/issues/10#event-724819661, or mute the thread https://github.com/notifications/unsubscribe-auth/AThPml9kbRB5IJtD49O5fUO_YK9gDtAJks5qV-N3gaJpZM4JNs3x .
Glad to hear that
Which R objects are accessible in Stata? It seems that "data objects" are not accessible in Stata with Rcall. I use R 3.3.0 and Stata 14.
According to http://www.haghish.com/packages/Rcall.php, "most" of the R objects are accessible in Stata. But I am unable to access "data objects" in the the "RecordLinkage" package. The package has two functions, compare.dedup for deduplication of a single dataset and compare.linkage for linking two datasets together. Both functions return an object of class "RecLinkData which includes, among other components, the resulting comparison patterns as component pairs. In the article R Journal Vol 2/2, December 2010 (available at https://journal.r-project.org/archive/2010-2/RJournal_2010-2_Sariyar+Borg.pdf), such an object was referred to as a data object.
I use the compare.linkage function in R despite that I prefer Stata because the package is better for record linkage than everything available in Stata. But for ease of troubleshooting, I will demonstrate the problem with the function compare.dedup. The following five lines of code are taken directly from the R Journal article on pages 61-62 :
R: library(RecordLinkage) R: data(RLdata500) R: RLdata500[1:5, ] R: rpairs <- compare.dedup(RLdata500, identity = identity.RLdata500) R: rpairs$pairs[1:5, ]
The last command should have created five lines of output but it did not. I can reproduce the results both directly in R and from within Stata using Roger Newson's command rsource but not using Rcall.
Anders