help [mailto:r-help-boun...@r-project.org] On Behalf Of greg
> holly
> > Sent: Thursday, February 2, 2017 4:13 PM
> > To: Rui Barradas
> > Cc: r-help mailing list
> > Subject: Re: [R] looping problem
> >
> > Thanks so much for this. Unfortunately, cbind did no
-40 which are basic for
data input and manipulation.
Cheers
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of greg holly
> Sent: Thursday, February 2, 2017 4:13 PM
> To: Rui Barradas
> Cc: r-help mailing list
> Subject: Re
Thanks so much for this. Unfortunately, cbind did not work. Basically, I
like to put an extra column named "chr" in the combined file from 22 chr.
So chr colum will be "1" for the portion of chr1 in the combined file, 2
for the portion of chr2 in the combined file and so on.
Regards,
Greg
On Thu
Hello,
If I understand correctly, just use ?cbind.
Rui Barradas
Em 02-02-2017 13:33, greg holly escreveu:
Hi Rui;
Is there any way to insert the chr ids in numeric as 1,2..,22 in the
final output. Here is output from str(temp). So I need also chr ids in a
column.
1 rs58108140 105
Hi Rui;
Is there any way to insert the chr ids in numeric as 1,2..,22 in the
final output. Here is output from str(temp). So I need also chr ids in a
column.
1 rs58108140 10583 G A -0.070438 0.059903
2 rs189107123 10611 C G -0.044916 0.085853
Regards,
Greg
On Wed, Feb 1, 20
Hi Rui;
I do appreciate for this. Thanks so much. I will try ASAP.
Regards,
Greg
On Wed, Feb 1, 2017 at 1:32 PM, Rui Barradas wrote:
> Hello,
>
> If what you want is to combine the files into one data.frame then there
> are 2 things you should see:
>
> 1) You create a variable named 'temp' an
Hello,
If what you want is to combine the files into one data.frame then there
are 2 things you should see:
1) You create a variable named 'temp' and don't ever use it.
2) You never combine the data.frames you read in.
Try instead the following.
temp <- data.frame()
for(i in 1:22) {
infi
Hi all;
I have 22 directories named chr1, chr2,,chr22. Each directory has a
file named "Z-score.imputed". I would like to combine Z-score.imputed
files into one. I wrote the following loop but did not get any results.
Your helps are highly appreciated.
regards,
Greg
temp<-c()
for(i in 1:2
armstrwa wrote:
>
> for(i in 1:length(gagehandles)){
>
> dates<-get(paste(gagehandles[i],"_amsd",sep=""))
> Error in get(paste(gagehandles[i], "_amsd", sep = "")) :
> variable names are limited to 256 bytes
>
> It didn't have a problem with the variable names before, so I'm not sure
> wh
Hi all,
I am trying to write a script that will automate the task of running a
Kendall's Tau correlation test on 75 time series that I am interested in.
The code I have written is:
for(i in 1:length(gagehandles)){
dates<-get(paste(gagehandles[i],"_amsd",sep=""))
q<-get(paste(gagehandles[i],"_a
You made a mistake with theta
theta<-c(0.08,0.06,0.09,0)
This should be (see the fortran)
theta<-c(0.06,0.08,0.09,0)
The innermost loop (for( k in ...) is better written as while loop to take
into account how Fortran handles loops (see the previous replies):
k <- i
while( k <=
Hi,
I would also like to point out that you flipped the first two the
values of theta in the R vs. FORTRAN versions. This fixes part of
your differences (and makes it easy to see that the differences occur
when j < i, as David and Mario point out).
Josh
On Sun, Aug 29, 2010 at 10:27 PM, Nam Let
When j==1 for loops from i down to zero. 5:0 is valid and means c(5,4,3,2,1,0)
Hope it helps
mario
Nam Lethanh wrote:
> Dear Guys,
>
> I do converting codes from Fortran into R and got stuck in solving LOOPING
> procedure with R. In FORTRAN, it is (DO and END DO) for loopi
On Aug 30, 2010, at 1:27 AM, Nam Lethanh wrote:
Dear Guys,
I do converting codes from Fortran into R and got stuck in solving
LOOPING
procedure with R. In FORTRAN, it is (DO and END DO) for looping in
the net.
In R, it is (FOR with { }).
Looking at the results (namely the 1's from t
Dear Guys,
I do converting codes from Fortran into R and got stuck in solving LOOPING
procedure with R. In FORTRAN, it is (DO and END DO) for looping in the net.
In R, it is (FOR with { }).
I believe there is something wrong with my coding in R, do hope that you can
help me solving following pr
Exactly what are you expecting the 'if' statement to do? By
definition, the 'if' only takes a single value and your expression is
probably a vector with many values and the error message is just
saying it will use only the first value to determine what to do. Are
you trying to check if 'any' or
Hi r-users,
I have this code below but I don't understand the error message:
cumdensity <- function(z)
{ alp <- 2.0165;
rho <- 0.868;
# simplified expressions
a <- alp-0.5
c1 <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)
c2 <- sqrt(rho)/(1-rho)
t1 <- exp(-z/(1-rho))
t2
Hi R-users,
I have this code here:
library(numDeriv)
fprime <- function(z)
{ alp <- 2.0165;
rho <- 0.868;
# simplified expressions
a <- alp-0.5
c1 <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)
c2 <- sqrt(rho)/(1-rho)
t1 <- exp(-z/(1-rho))
t2 <- (z/(2*c2))^a
bes1
Hi R-users,
Â
I have this code below and use some code from sn package for multivariate
skew t (rmst) to generate a set of random numbers.  I try to do a looping to
produce ârandâ for different values of degrees of freedom (degf).Â
Actually, Iâm not sure how to specify the attribut
Roslina Zakaria wrote:
> Dear r-expert,
> I would like to generate 30 sets of random numbers from uniform distribution
> (0,1). Each set of random numbers should have 90 data. Here is my code:
> rand.no <- function(n,itr)
> { for (i in 1:itr)
> {rand.1 <- runif(n,0,1)
> if (i ==1) rand.2 <-
Dear r-expert,
I would like to generate 30 sets of random numbers from uniform distribution
(0,1). Each set of random numbers should have 90 data. Here is my code:
rand.no <- function(n,itr)
{ for (i in 1:itr)
{rand.1 <- runif(n,0,1)
if (i ==1) rand.2 <- rand.1
else rand.2 <- cbind(rand.2,r
> I would like to do looping for this process below to estimate alpha
> beta from gamma distribution:
> Here are my data:
> day_data1 <-
> 123456 789 10 11 12
> 13 14 15 16 17 18 19 20 21 22 23
> 1943 48.3 18.5 0.0 0.0 18.3 0.0
Hi R-users,
I would like to do looping for this process below to estimate alpha beta from
gamma distribution:
Here are my data:
day_data1 <-
123456 789 10 11 12 13 14 15
16 17 18 19 20 21 22 23
1943 48.3 18.5 0.0 0.0 18.3 0.0
23 matches
Mail list logo