Re: [Rpy] Is there an easy way to make a dataframe with different value lengths?

2012-04-03 Thread Niek de Klein
Alright, I'll just keep on adding the NA_Reals myself. Thanks to you both, Niek On Tue, Apr 3, 2012 at 5:12 PM, Laurent Gautier wrote: > On 2012-04-03 16:51, Dirk Eddelbuettel wrote: > > On 3 April 2012 at 15:31, Niek de Klein wrote: > > | Hi everyone, > > | > >

[Rpy] Is there an easy way to make a dataframe with different value lengths?

2012-04-03 Thread Niek de Klein
Hi everyone, When I do: import rpy2.robjects as R exampleDict = {'colum1':R.IntVector([1,2,3]), 'column2':R.FloatVector([1,2]), 'column3':R.FloatVector([1,2,3,4])} R.DataFrame(exampleDict) I get the error that the rows are not of the same lenghts: "arguments imply differing number of rows: 2, 4

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-26 Thread Niek de Klein
Try it without the if statement: r_exec = os.path.join(r_home, 'bin', 'R') # Changed --- import subprocess rp = subprocess.check_output([r_exec, '--version'], stderr=subprocess.STDOUT).decode('ascii').splitlines() # removed the if statement rversion = rp[1] #

Re: [Rpy] Problem with installing rpy2 to Python3

2012-03-25 Thread Niek de Klein
Hi Yuanda, I haven't had this problem myself so I don't know if the solutions given here: http://stackoverflow.com/questions/4924917/trouble-installing-rpy2-on-win7-r-2-12-python-2-5. actually work, but it seems like a solution. Cheers, Niek On Sun, Mar 25, 2012 at 8:47 AM, Yuanda Zhu wrote:

Re: [Rpy] How can I get an index vector in rpy2, or if that doesn't exist, how can I select two columns?

2012-02-27 Thread Niek de Klein
t approach, or if there is a way to use index vectors. Kind regards, Niek On Mon, Feb 27, 2012 at 10:00 AM, Niek de Klein wrote: > This only shows how to extract 1 row, 1 column or 1 element. I want to get > 2 columns out of a matrix and save that in a new matrix. > > Kind regards, >

Re: [Rpy] How can I get an index vector in rpy2, or if that doesn't exist, how can I select two columns?

2012-02-27 Thread Niek de Klein
> Best, > > > L. > > > > On 2012-02-24 18:26, Niek de Klein wrote: > > Hi, > > I want to do the same thing as in the R example found here: > http://www.r-tutor.com/r-introduction/data-frame/data-frame-column-slice. > He makes use of the mtcars datase which looks li

[Rpy] How can I get an index vector in rpy2, or if that doesn't exist, how can I select two columns?

2012-02-24 Thread Niek de Klein
Hi, I want to do the same thing as in the R example found here: http://www.r-tutor.com/r-introduction/data-frame/data-frame-column-slice. He makes use of the mtcars datase which looks like this: mpg cyl disp hp drat wt ... Mazda RX4 21.0 6 160 110 3.90 2.62 ...

[Rpy] How do use rgb/how to color histograms?

2012-02-23 Thread Niek de Klein
Hi everyone, Sorry for the double mail, I accidentaly pushed a button that send it off before I was finished. I'm trying to rebuild a R example in rpy2 given in this thread in stackoverflow: http://stackoverflow.com/questions/3541713/how-to-plot-two-histograms-together-in-r. The example looks lik

[Rpy] (no subject)

2012-02-23 Thread Niek de Klein
Hi everyone, I'm trying to rebuild a R example in rpy2 given in this thread in stackoverflow: http://stackoverflow.com/questions/3541713/how-to-plot-two-histograms-together-in-r. The example looks like this: set.seed(42) p1 <- hist(rnorm(500,4)) # centered at 4 p2