Displaying 9 results from an estimated 9 matches for "moonja".
Did you mean:
moona
2010 Nov 29
3
how to use by() ?
Hello, All!
How might one accomplish this using the by() function?
m1 is a data frame.
# populate column "m1$major_allele"
for ( i in 1:length(m1$major_allele)) {
if ( m1$Freq1[i] == m1$MAF[i]){
m1$major_allele[i] = m1$Al1[i]
}
else{
m1$major_allele[i] = m1$Al2[i]
}
}
Jim
[[alternative HTML version deleted]]
2011 Feb 04
1
GWAF package: lme.batch.imputed(): object 'kmat' not found
Hello, All,
GWAF 1.2
R.Version() is below.
system(lme.batch.imputed(
phenfile = 'phenfile.csv',
genfile = 'CARe_imputed_release.0.fhsR.gz',
pedfile='pedfile.csv',
phen='phen1',
covar=c('covar1','covar2'),
kinmat='imputed_fhs.kinship.RData',
outfile='imputed.FHS.IBC.GWAF.LME.output.0.txt'
))
Gives the error messages:
Error in
2011 Jan 26
2
write.table -- maintain decimal places
Hello, All,
How can I maintain the decimal places when using write.table()?
Jim
e.g.
df:
EFFECT2 PVALUE
1 0.023 0.88080
2 -0.260 0.08641
3 -0.114 0.45200
write.table(df,file='df.txt',quote=F,sep='\t',row.names=F)
df.txt:
EFFECT2 PVALUE
0.023 0.8808
-0.26 0.08641
-0.114 0.452
[[alternative HTML version deleted]]
2010 Dec 08
1
sd() for numeric row entries
How might one calculate standard deviation, row-wise, for the numeric values in a data frame such as this one
V1 V2 V3 V4 V5
1 rs11089130 0.4565 0.4574 0.4569 0.4572
2 rs738829 0.6548 0.6519 0.6448 0.6549
3 rs915674 0.7503 0.7500 0.7517 0.7502
and place the standard deviation in a 6th column called “std_dev”?
Regards,
Jim
[[alternative HTML version deleted]]
2011 Feb 17
2
sort by column and row names
Hello, All,
How can one sort on column and row names. For example:
How can this
X1 X3 X2
X1 1 0 0
X3 0 1 0
X2 0 0 1
become this?
X1 X2 X3
X1 1 0 0
X2 0 1 0
X3 0 0 1
Thank you for your time!
Jim
[[alternative HTML version deleted]]
2010 Dec 21
1
Write.table eol argument
Hello All,
R 2.11.1
Windows XP, 32-bit
Help says that default is eol=''\n''. To me, that represents Linefeed (LF)
>From Help:
eol the character(s) to print at the end of each line (row). For example, eol="\r\n" will produce Windows'' line endings on a Unix-alike OS, and eol="\r" will produce files as expected by Mac OS Excel 2004.
I would
2010 Dec 23
1
with(data.frame,ifelse(___,___,___))
Hello, All,
Mac OS 10.6.5
R64 2.11.1
This works as expected:
f1 = c(0.084, 0.099, 0)
data= data.frame(f1)
data$f1=with(data,ifelse(f1==0, 0.0001, f1))
data
f1
1 0.0840
2 0.0990
3 0.0001
Substituting ''f1==0'' with ''T'' produces the expected result:
f1 = c(0.084, 0.099, 0)
data= data.frame(f1)
data$f1=with(data,ifelse(T, 0.0001, f1))
data
f1
1 1e-04
2011 Jan 14
2
read in data, maintain decimal places
Good day, All,
Is there any way to maintain the number of decimal places in the type of situation below?
I would like to maintain the number of decimal places in 0.667, despite the fact that its column-mates have a fourth decimal place.
Thank you for your time.
Jim
dat.txt contents:
MARKER ALLELES FREQ1 RSQR EFFECT2 STDERR CHISQ PVALUE
rs6599753 C,T
2010 Nov 29
2
FW: how to use by() ?
Thank you for the suggestion, Bill. The result is not quite what I would like. Here's sample code for you or anyone else who may be interested:
Al1 = c('A','C','C','C')
Al2 = c('G','G','G','T')
Freq1 = c(0.0078,0.0567,0.9434,0.9908)
MAF = c(0.0078,0.0567,0.0566,0.0092)
m1 = data.frame(Al1=Al1,