Re: [R] One Dimensional Monte Carlo Simulation

2017-07-14 Thread HUL-Anthony Egerton
Further to my email below, I have just realised that I forgot to include the specification of L and R. Hence, the code needs to include the following additional lines at the start;- L<-7.5e6 R<-2.5e6 Apologies for any confusion caused! Best regards, Tony > On 12 Jul 2017, at 10:03 AM, HUL-A

Re: [R] Making 2 dimensional vector from the 3 dimensional one

2017-07-14 Thread Bert Gunter
Like this ? y <- array(1:24, dim = 2:4) yy <- array(y, dim = c(6,4)) > y , , 1 [,1] [,2] [,3] [1,]135 [2,]246 , , 2 [,1] [,2] [,3] [1,]79 11 [2,]8 10 12 , , 3 [,1] [,2] [,3] [1,] 13 15 17 [2,] 14 16 18 , , 4 [,1] [,

Re: [R] Making 2 dimensional vector from the 3 dimensional one

2017-07-14 Thread Jim Lemon
Hi Gabi, Let's say you have something like this: gc_array<-array(1:27,c(3,3,3)) > gc_array , , 1 [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 , , 2 [,1] [,2] [,3] [1,] 10 13 16 [2,] 11 14 17 [3,] 12 15 18 , , 3 [,1] [,2] [,3] [1,]

Re: [R] Making 2 dimensional vector from the 3 dimensional one

2017-07-14 Thread Rolf Turner
On 14/07/17 21:43, Csima, Gabriella wrote: Hi All, I want to make a 1 dimension vector from the first two dimensions of a 3 dimension array, so make a 2 dimension vector from a 3-dimension one, with "fusing" (making as.vector) the first two dimensions. It seems to be very easy, but I cannot f

Re: [R] Conduct Network Analysis

2017-07-14 Thread Rainer Krug
I don’t know anything about network analysis, but I really guess that more information is needed to give an answer. Cheers, Rainer > On 14 Jul 2017, at 05:08, SEB140004 Student wrote: > > Greeting. > > Dear Mr/Mrs/Miss, > > I want to create a network by using R but I only have a table that

[R] Making 2 dimensional vector from the 3 dimensional one

2017-07-14 Thread Csima, Gabriella
Hi All, I want to make a 1 dimension vector from the first two dimensions of a 3 dimension array, so make a 2 dimension vector from a 3-dimension one, with "fusing" (making as.vector) the first two dimensions. It seems to be very easy, but I cannot find the solution, I mean it would very strange

Re: [R] Efficient Binning

2017-07-14 Thread Jeff Newmiller
?cut cut( 0.51, boundaries ) You can also use as.integer to convert the resulting factor to an integer. -- Sent from my phone. Please excuse my brevity. On July 14, 2017 7:10:59 AM PDT, Dan Abner wrote: >Hi all, > >I have a situation where I have 16 bins. I generate a random number and >then

Re: [R] Efficient Binning

2017-07-14 Thread Marc Schwartz
> On Jul 14, 2017, at 9:10 AM, Dan Abner wrote: > > Hi all, > > I have a situation where I have 16 bins. I generate a random number and > then want to know which bin number the random number falls in. Right now, I > am using a serious of 16 if() else {} statements which get very complicated > w

[R] Efficient Binning

2017-07-14 Thread Dan Abner
Hi all, I have a situation where I have 16 bins. I generate a random number and then want to know which bin number the random number falls in. Right now, I am using a serious of 16 if() else {} statements which get very complicated with the embedded curly braces. Is there a more efficient (i.e., e

Re: [R] setwd in windows

2017-07-14 Thread Duncan Murdoch
On 14/07/2017 7:42 AM, Troels Ring wrote: Dear friends - windows R 3.3.3 - sorry to ask a simple question - but I cannot make setwd work properly in scripts In the example below I have made a directory in C (firstdir) and a directory in that (secdir) and the intention is to change directory to t

Re: [R] setwd in windows

2017-07-14 Thread Troels Ring
Fine - no nothing is wrong with setwd("./secdir") but I got the other code with the tilde as a supplementum and wondered why I couldn't make it work. I believe R_USER was successfully renamed - and per the faq thought it should work as specified. Small problem though Troels Den 14-07-2017 k

Re: [R] Help with R script

2017-07-14 Thread Vijayan Padmanabhan
Thanks Ulrik and MacQueen I am taking inputs from both your options to arrive at the solution that will work for my specific requirements.. Will post my final solution once I succeed..which could help others with similar challenge in their work.. Appreciate both your time shared on suggesting these

Re: [R] setwd in windows

2017-07-14 Thread peter dalgaard
I am not sure what is going on here. The example seems incomplete. At any rate: (a) I would be wary of changing my home directory mid-session. That is usually just not done. (b) For a relative directory change, is anything wrong with setwd("./secdir") ? -pd > On 14 Jul 2017, at 13:42 , Troels

[R] setwd in windows

2017-07-14 Thread Troels Ring
Dear friends - windows R 3.3.3 - sorry to ask a simple question - but I cannot make setwd work properly in scripts In the example below I have made a directory in C (firstdir) and a directory in that (secdir) and the intention is to change directory to the second from the first - it works when

Re: [R] Conduct Network Analysis

2017-07-14 Thread Boris Steipe
Have a look at the functions available in the igraph package. B. > On Jul 13, 2017, at 11:08 PM, SEB140004 Student > wrote: > > Greeting. > > Dear Mr/Mrs/Miss, > > I want to create a network by using R but I only have a table that contain > OTU ID and the abundance value of two sample

Re: [R] Conduct Network Analysis

2017-07-14 Thread Rainer Krug
I don’t know anything about network analysis, but I really guess that more information is needed to give an answer. Cheers, Rainer > On 14 Jul 2017, at 05:08, SEB140004 Student wrote: > > Greeting. > > Dear Mr/Mrs/Miss, > > I want to create a network by using R but I only have a table that

Re: [R] bnlearn and cpquery

2017-07-14 Thread Ross Chapman
Dear Marco, Thanks for your helpful comments. Using the posterior estimates seems to have fixed the problem. Ross From: Marco Scutari [mailto:marco.scut...@gmail.com] Sent: Thursday, 13 July 2017 7:35 PM To: Ross Chapman Cc: r-help Subject: Re: [R] bnlearn and cpquery Dear