viewing data in something similar to 'R Data Editor'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

viewing data in something similar to 'R Data Editor'

Rachel Schwartz
Hi,

I would like to view matrices I am working with in a clean, easy to read,
separate window.

A friend showed me how to do something like I want  with edit(). I can view
the matrix in the 'R Data Editor':

For a sample matrix:

> mat=matrix(1:15,ncol=3)
> mat
     [,1] [,2] [,3]
[1,]    1    6   11
[2,]    2    7   12
[3,]    3    8   13
[4,]    4    9   14
[5,]    5   10   15


> look=function(x) invisible(edit(x))
> look(mat)

That opens the 'R Data Editor' with mat loaded.


But I am not able to do any other actions in R while this 'R Data Editor' is
open. I want to keep this open while
I do other work.

Is there a way to view my data in something like the 'R Data Editor' that
still allows me to do work at the same time?
I am looking for something other than  str(), head(), and tail() which just
allow me a quick peak at the object. I do not
want to edit the object in the table, but be able to watch the object change
while I run anything that would manipulate it.

Thank you for your help.

Best,
Rachel Schwartz
Graduate Student Researcher
UCSD; Scripps Institution of Oceanography

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

Erik Iverson
See ?View but I don't think it 'auto updates' per your last sentence.
Maybe there's a better option?

Rachel Schwartz wrote:

> Hi,
>
> I would like to view matrices I am working with in a clean, easy to read,
> separate window.
>
> A friend showed me how to do something like I want  with edit(). I can view
> the matrix in the 'R Data Editor':
>
> For a sample matrix:
>
>> mat=matrix(1:15,ncol=3)
>> mat
>      [,1] [,2] [,3]
> [1,]    1    6   11
> [2,]    2    7   12
> [3,]    3    8   13
> [4,]    4    9   14
> [5,]    5   10   15
>
>
>> look=function(x) invisible(edit(x))
>> look(mat)
>
> That opens the 'R Data Editor' with mat loaded.
>
>
> But I am not able to do any other actions in R while this 'R Data Editor' is
> open. I want to keep this open while
> I do other work.
>
> Is there a way to view my data in something like the 'R Data Editor' that
> still allows me to do work at the same time?
> I am looking for something other than  str(), head(), and tail() which just
> allow me a quick peak at the object. I do not
> want to edit the object in the table, but be able to watch the object change
> while I run anything that would manipulate it.
>
> Thank you for your help.
>
> Best,
> Rachel Schwartz
> Graduate Student Researcher
> UCSD; Scripps Institution of Oceanography
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

Rachel Schwartz
Thanks Erik, almost worked! I am a mac user and for some reason  View worked
perfectly for my PC using friend, but
doesn't for me.

When I tried:
> mat=matrix(1:10,ncol=2)
> mat
     [,1] [,2]
[1,]    1    6
[2,]    2    7
[3,]    3    8
[4,]    4    9
[5,]    5   10
> View(mat)

I get no error message, but nothing happens (besides spinning ball of death)
and I have to force quit R. I tried
a couple different variations but still no success with using View.

Suggestions?



On Fri, Aug 1, 2008 at 10:52 AM, Erik Iverson <[hidden email]>wrote:

> See ?View but I don't think it 'auto updates' per your last sentence. Maybe
> there's a better option?
>
> Rachel Schwartz wrote:
>
>> Hi,
>>
>> I would like to view matrices I am working with in a clean, easy to read,
>> separate window.
>>
>> A friend showed me how to do something like I want  with edit(). I can
>> view
>> the matrix in the 'R Data Editor':
>>
>> For a sample matrix:
>>
>>  mat=matrix(1:15,ncol=3)
>>> mat
>>>
>>     [,1] [,2] [,3]
>> [1,]    1    6   11
>> [2,]    2    7   12
>> [3,]    3    8   13
>> [4,]    4    9   14
>> [5,]    5   10   15
>>
>>
>>  look=function(x) invisible(edit(x))
>>> look(mat)
>>>
>>
>> That opens the 'R Data Editor' with mat loaded.
>>
>>
>> But I am not able to do any other actions in R while this 'R Data Editor'
>> is
>> open. I want to keep this open while
>> I do other work.
>>
>> Is there a way to view my data in something like the 'R Data Editor' that
>> still allows me to do work at the same time?
>> I am looking for something other than  str(), head(), and tail() which
>> just
>> allow me a quick peak at the object. I do not
>> want to edit the object in the table, but be able to watch the object
>> change
>> while I run anything that would manipulate it.
>>
>> Thank you for your help.
>>
>> Best,
>> Rachel Schwartz
>> Graduate Student Researcher
>> UCSD; Scripps Institution of Oceanography
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

Erik Iverson


Rachel Schwartz wrote:

> Thanks Erik, almost worked! I am a mac user and for some reason  View
> worked perfectly for my PC using friend, but
> doesn't for me.
>
> When I tried:
>  > mat=matrix(1:10,ncol=2)
>  > mat
>      [,1] [,2]
> [1,]    1    6
> [2,]    2    7
> [3,]    3    8
> [4,]    4    9
> [5,]    5   10
>  > View(mat)
>
> I get no error message, but nothing happens (besides spinning ball of
> death) and I have to force quit R. I tried
> a couple different variations but still no success with using View.
>
> Suggestions?

Not from me, no Mac here.  Maybe someone else?  Or else there is a Mac
specific list, R-SIG-Mac, google for it.

>
>
>
> On Fri, Aug 1, 2008 at 10:52 AM, Erik Iverson <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     See ?View but I don't think it 'auto updates' per your last
>     sentence. Maybe there's a better option?
>
>     Rachel Schwartz wrote:
>
>         Hi,
>
>         I would like to view matrices I am working with in a clean, easy
>         to read,
>         separate window.
>
>         A friend showed me how to do something like I want  with edit().
>         I can view
>         the matrix in the 'R Data Editor':
>
>         For a sample matrix:
>
>             mat=matrix(1:15,ncol=3)
>             mat
>
>             [,1] [,2] [,3]
>         [1,]    1    6   11
>         [2,]    2    7   12
>         [3,]    3    8   13
>         [4,]    4    9   14
>         [5,]    5   10   15
>
>
>             look=function(x) invisible(edit(x))
>             look(mat)
>
>
>         That opens the 'R Data Editor' with mat loaded.
>
>
>         But I am not able to do any other actions in R while this 'R
>         Data Editor' is
>         open. I want to keep this open while
>         I do other work.
>
>         Is there a way to view my data in something like the 'R Data
>         Editor' that
>         still allows me to do work at the same time?
>         I am looking for something other than  str(), head(), and tail()
>         which just
>         allow me a quick peak at the object. I do not
>         want to edit the object in the table, but be able to watch the
>         object change
>         while I run anything that would manipulate it.
>
>         Thank you for your help.
>
>         Best,
>         Rachel Schwartz
>         Graduate Student Researcher
>         UCSD; Scripps Institution of Oceanography
>
>                [[alternative HTML version deleted]]
>
>         ______________________________________________
>         [hidden email] <mailto:[hidden email]> mailing list
>         https://stat.ethz.ch/mailman/listinfo/r-help
>         PLEASE do read the posting guide
>         http://www.R-project.org/posting-guide.html
>         and provide commented, minimal, self-contained, reproducible code.
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

Jim Porzak
In reply to this post by Rachel Schwartz
Rachel,

You may want to try JGR, http://jgr.markushelbig.org/JGR.html

which has, among many nice IDE features, an object browser that will
do what you want.


HTH,
Jim Porzak
Responsys, Inc.
San Francisco, CA
http://www.linkedin.com/in/jimporzak
useR Group SF: http://ia.meetup.com/67/



On Fri, Aug 1, 2008 at 10:29 AM, Rachel Schwartz <[hidden email]> wrote:

> Hi,
>
> I would like to view matrices I am working with in a clean, easy to read,
> separate window.
>
> A friend showed me how to do something like I want  with edit(). I can view
> the matrix in the 'R Data Editor':
>
> For a sample matrix:
>
>> mat=matrix(1:15,ncol=3)
>> mat
>     [,1] [,2] [,3]
> [1,]    1    6   11
> [2,]    2    7   12
> [3,]    3    8   13
> [4,]    4    9   14
> [5,]    5   10   15
>
>
>> look=function(x) invisible(edit(x))
>> look(mat)
>
> That opens the 'R Data Editor' with mat loaded.
>
>
> But I am not able to do any other actions in R while this 'R Data Editor' is
> open. I want to keep this open while
> I do other work.
>
> Is there a way to view my data in something like the 'R Data Editor' that
> still allows me to do work at the same time?
> I am looking for something other than  str(), head(), and tail() which just
> allow me a quick peak at the object. I do not
> want to edit the object in the table, but be able to watch the object change
> while I run anything that would manipulate it.
>
> Thank you for your help.
>
> Best,
> Rachel Schwartz
> Graduate Student Researcher
> UCSD; Scripps Institution of Oceanography
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

Gabor Grothendieck
In reply to this post by Rachel Schwartz
Try view in the svViews package.

On Fri, Aug 1, 2008 at 1:29 PM, Rachel Schwartz <[hidden email]> wrote:

> Hi,
>
> I would like to view matrices I am working with in a clean, easy to read,
> separate window.
>
> A friend showed me how to do something like I want  with edit(). I can view
> the matrix in the 'R Data Editor':
>
> For a sample matrix:
>
>> mat=matrix(1:15,ncol=3)
>> mat
>     [,1] [,2] [,3]
> [1,]    1    6   11
> [2,]    2    7   12
> [3,]    3    8   13
> [4,]    4    9   14
> [5,]    5   10   15
>
>
>> look=function(x) invisible(edit(x))
>> look(mat)
>
> That opens the 'R Data Editor' with mat loaded.
>
>
> But I am not able to do any other actions in R while this 'R Data Editor' is
> open. I want to keep this open while
> I do other work.
>
> Is there a way to view my data in something like the 'R Data Editor' that
> still allows me to do work at the same time?
> I am looking for something other than  str(), head(), and tail() which just
> allow me a quick peak at the object. I do not
> want to edit the object in the table, but be able to watch the object change
> while I run anything that would manipulate it.
>
> Thank you for your help.
>
> Best,
> Rachel Schwartz
> Graduate Student Researcher
> UCSD; Scripps Institution of Oceanography
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

Erich Neuwirth
In reply to this post by Rachel Schwartz
On Windows, this could be done with rcom and Excel.
rcom can use Excel as a server and put matrices into Excel ranges.
The code you run in R could have a statement resending matrices so the  
current
version is displayed.

I could set up more conveniently what yo want if RGui had a way
of automatically running a function each time code is run from the  
command line.
So here is a question to the masters:
Can I have code automatically run each time some code
is run from the command line?




On Aug 1, 2008, at 7:29 PM, Rachel Schwartz wrote:

> Hi,
>
> I would like to view matrices I am working with in a clean, easy to  
> read,
> separate window.
>
> A friend showed me how to do something like I want  with edit(). I  
> can view
> the matrix in the 'R Data Editor':
>
> For a sample matrix:
>
>> mat=matrix(1:15,ncol=3)
>> mat
>     [,1] [,2] [,3]
> [1,]    1    6   11
> [2,]    2    7   12
> [3,]    3    8   13
> [4,]    4    9   14
> [5,]    5   10   15
>
>
>> look=function(x) invisible(edit(x))
>> look(mat)
>
> That opens the 'R Data Editor' with mat loaded.
>
>
> But I am not able to do any other actions in R while this 'R Data  
> Editor' is
> open. I want to keep this open while
> I do other work.
>
> Is there a way to view my data in something like the 'R Data Editor'  
> that
> still allows me to do work at the same time?
> I am looking for something other than  str(), head(), and tail()  
> which just
> allow me a quick peak at the object. I do not
> want to edit the object in the table, but be able to watch the  
> object change
> while I run anything that would manipulate it.
>
> Thank you for your help.
>
> Best,
> Rachel Schwartz
> Graduate Student Researcher
> UCSD; Scripps Institution of Oceanography
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

Philippe Grosjean
Erich Neuwirth wrote:

> On Windows, this could be done with rcom and Excel.
> rcom can use Excel as a server and put matrices into Excel ranges.
> The code you run in R could have a statement resending matrices so the
> current
> version is displayed.
>
> I could set up more conveniently what yo want if RGui had a way
> of automatically running a function each time code is run from the
> command line.
> So here is a question to the masters:
> Can I have code automatically run each time some code
> is run from the command line?

This is something I have already asked. It seems this is not possible
currently. Something like ?addTaskCallback, but registering an R
function that is to be called *before* a top-level task is run would be
wonderful (???addTaskStart).
Best,

Philippe Grosjean

P.S.: this would solve also another problem we have for some GUIs: to
know if R is busy processing commands issued at the command line or not
(just set a busy flag to TRUE with a function registered with
"addTaskStart", and set it to FALSE with a function registered with
addTaskCallback). Of course, a R function that provides this information
more directly would be much, much better.

>
>
>
> On Aug 1, 2008, at 7:29 PM, Rachel Schwartz wrote:
>
>> Hi,
>>
>> I would like to view matrices I am working with in a clean, easy to read,
>> separate window.
>>
>> A friend showed me how to do something like I want  with edit(). I can
>> view
>> the matrix in the 'R Data Editor':
>>
>> For a sample matrix:
>>
>>> mat=matrix(1:15,ncol=3)
>>> mat
>>     [,1] [,2] [,3]
>> [1,]    1    6   11
>> [2,]    2    7   12
>> [3,]    3    8   13
>> [4,]    4    9   14
>> [5,]    5   10   15
>>
>>
>>> look=function(x) invisible(edit(x))
>>> look(mat)
>>
>> That opens the 'R Data Editor' with mat loaded.
>>
>>
>> But I am not able to do any other actions in R while this 'R Data
>> Editor' is
>> open. I want to keep this open while
>> I do other work.
>>
>> Is there a way to view my data in something like the 'R Data Editor' that
>> still allows me to do work at the same time?
>> I am looking for something other than  str(), head(), and tail() which
>> just
>> allow me a quick peak at the object. I do not
>> want to edit the object in the table, but be able to watch the object
>> change
>> while I run anything that would manipulate it.
>>
>> Thank you for your help.
>>
>> Best,
>> Rachel Schwartz
>> Graduate Student Researcher
>> UCSD; Scripps Institution of Oceanography
>>
>>     [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: viewing data in something similar to 'R Data Editor'

D L McArthur
In reply to this post by Rachel Schwartz
With the R prompt still active, data may be cleanly viewed (not
edited) in a separate window by a simplification of function xless in
Hmisc by Frank Harrell:

look. <- function (x, ...,
      title = substring(deparse(substitute(x)), 1, 20))
     {
      page(x, method = "print", title = title,options=(width=150))
         invisible()
     }

Names alone can be viewed separately as well:

names.
function (x, ...,
      title = c(substring(deparse(substitute(x)), 1, 20)))
     {       title=paste(title," ...NAMES")
      page(names(x), method = "print", title = title,options=(width=150))
         invisible()
     }

Both functions work in Windows XP and Mac OS X Leopard under R 2.7.1
and earlier.

-- D L McArthur, UCLA Department of Neurosurgery

 >
 > On Aug 1, 2008, at 7:29 PM, Rachel Schwartz wrote:
 >
 >> Hi,
 >>
 >> I would like to view matrices I am working with in a clean, easy to read,
 >> separate window.
 >>
 >> A friend showed me how to do something like I want  with edit(). I can
 >> view
 >> the matrix in the 'R Data Editor':
 >>
 >> For a sample matrix:
 >>
 >>> mat=matrix(1:15,ncol=3)
 >>> mat
 >>     [,1] [,2] [,3]
 >> [1,]    1    6   11
 >> [2,]    2    7   12
 >> [3,]    3    8   13
 >> [4,]    4    9   14
 >> [5,]    5   10   15
 >>
 >>
 >>> look=function(x) invisible(edit(x))
 >>> look(mat)
 >>
 >> That opens the 'R Data Editor' with mat loaded.
 >>
 >>
 >> But I am not able to do any other actions in R while this 'R Data
 >> Editor' is
 >> open. I want to keep this open while
 >> I do other work.
 >>
 >> Is there a way to view my data in something like the 'R Data Editor' that
 >> still allows me to do work at the same time?
 >> I am looking for something other than  str(), head(), and tail() which
 >> just
 >> allow me a quick peak at the object. I do not
 >> want to edit the object in the table, but be able to watch the object
 >> change
 >> while I run anything that would manipulate it.
 >>
 >> Thank you for your help.
 >>
 >> Best,
 >> Rachel Schwartz
 >> Graduate Student Researcher
 >> UCSD; Scripps Institution of Oceanography

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.