Displaying 20 results from an estimated 11000 matches similar to: "how to handle missing values "." when importing data in R"
2010 Jul 14
4
question about string handling....
Hi,
I have a data.frame as following:
var1 var2
1 ab_c_(ok)
2 okf789(db)_c
3 jojfiod(90).gt
4 "ij"_(78)__op
5 (iojfodjfo)_ab
what I want is to create a new variable called "var3". the value of var3 is
the content in the Parentheses. so var3 would be:
var3
ok
db
90
78
iojfodjfo
how to do this?
thanks,
karena
--
2010 Jan 13
4
a question about deleting rows
I have a file like this:
id n1 n2 n3 n4 n5 n6
1 3 4 7 8 10 2
2 4 1 2 4 3 10
3 7 0 0 0 0 8
4 10 1 0 0 2 3
5 11 1 0 0 0 5
what I want to do is: only if n2=0 and n3=0 and n4=0 and n5=0 then delete
the row. how can I do that?
thank you,
karena
--
View this message
2010 Aug 05
2
a question about 'read.table' with or without 'read.table'.(urgent)
Hi, I've got a quite tricky question.
I have a txt file, named 'temp.txt', as the following:
snp1 snp2 snp3
AA 00 00
GG GG 00
00 AA 00
I want to read the file into R.
1) when I use 'read.table' without 'header=T' option,
> temp <- read.table('temp.txt')
# I got
> temp
V1
2010 Apr 22
6
macro variable in R?
I need to create 10 matrices. say matrix 1-10.
matrix_1 is 1 by 1
matrix_2 is 2 by 2
matrix_3 is 3 by 3
.
.
.
matrix_10 is 10 by 10
I am just wondering if there are some functions in R that are similar to the
macro variables in SAS. so I can create these 10 matrices by doing:
for (i in 1: 10) {
matrix_$i <- matrix(nrow=i, ncol=i)
}
rather thank creating these matrices one by one
2010 Jun 03
5
string handling
I have a data.frame as the following:
var1 var2
9G/G09 abd89C/T90
10A/T9 32C/C
90G/G A/A
. .
. .
. .
10T/C 00G/G90
What I want is to get the letters which are on the left and right of '/'.
for example, for "9G/G09", I only want "G", "G", and for "abd89C/T90", I
only want "C" and
2011 Oct 19
2
A questions regarding R plots
Hi Dear all,
I am making Venn Diagram plots in R. I attached an example:
http://r.789695.n4.nabble.com/file/n3919206/venn.jpeg
I want to get rid of the black boarder line, is there any way to do it?
Thank you very much,
Karena
--
View this message in context: http://r.789695.n4.nabble.com/A-questions-regarding-R-plots-tp3919206p3919206.html
Sent from the R help mailing list archive at
2010 May 04
2
question about 'write.table'
I have a question about the "write.table"
I have 100 data.frames, loci1, loci2, loci3.............,loci100.
now, I want to print these data.frames to 100 separate files, and the names
of the files are also loci1, loci2, loci3,......., loci100.
how to perform this under a "for" loop?
say,
for (i in 1:100) {
write.table(...., file='...', ........)
}
thank you,
2010 Jul 16
2
a issue about the qutation mark?
Following is a function that I wrote (It is working well). It's a simple one,
nothing complicated. The only question that I have is a qutation mark issue,
I guess.
#############################################
funcname <- function(trait.file){ #line1
setwd('/root/subroot') # line 2
load('imge.RData')
2010 Aug 05
2
questions about string handling
Hi, I have a question about the data handling. I have a dataset as following:
ID snp1 snp2 snp3
1001 0/0 1/1 1/1
1002 2/2 3/3 1/1
1003 4/4 3/3 2/2
I want to convert the dataset to the following format:
ID snp1 snp2 snp3
1001 00 AA AA
1002 GG
2011 Jul 21
4
Random number generation
Hi,
I want to generate multiple sets of random numbers.
The requirement is that:
1) each set have 3 random numbers;
2) the sum of the three number is always 1.
how to do this?
thank you,
karena
--
View this message in context: http://r.789695.n4.nabble.com/Random-number-generation-tp3685463p3685463.html
Sent from the R help mailing list archive at Nabble.com.
2010 Sep 08
2
a question about replacing the value in the data.frame
I have a data.frame as follows:
v1 v2 v3 v4 v5.....v100
1 1 0 0 1 2
2 1 2 1 0 1
1 1 1 2 1 0
. . . . . .
. . . . . .
1 2 2 1 1 0
so for this data set, what I wanna do is to replace all the
2010 Nov 02
2
how to make multiple curves in one plot
hello,
plot(running(-log10(results_chr_p$empi_p), fun=mean, width=41, font.axis=4,
by=1),type="l",cex=0.1, ylab="-Log(p)", ylim=c(0,5.0), xlab=" ", lwd=2)
this is my code to make a plot. The problem is, now I want to add one more
curve to the plot, which is for another variable in the data.frame
-log10(results_chr_p$p). My question is: how to make multiple lines
2011 Jun 15
4
R string functions
Hi,
I have a string "GGGGGGCCCAATCGCAATTCCAATT"
What I want to do is to count the percentage of each letter in the string,
what string functions can I use to count the number of each letter appearing
in the string?
For example, the letter "A" appeared 6 times, letter "T" appeared 5 times,
how can I use a string function to get the these number?
thanks,
karena
2011 Sep 14
1
Questons about 'igraph' package
Hi,
I am using 'igraph' to make some plots. The problem I got is that I don't
know how to label the nodes with gene names.
My sample code:
## suppose I have 100 gene (nodes) ##
---------------------------------------------------------------------------
graph <- set.vertex.attribute(graph, "color",
value=c(rep(c('green','red'),50)))
graph <-
2012 Mar 07
2
fill=T?
If a text file has rows of variable lengths. How to read the file into R?
I think some people may suggest using 'fill=T', however, it sort of messes
the data up, for example, in the text file:
a b c d
1 2 3 4
1 8 6
1 2 0
1 1 0
If I read in the file using 'read.table("data", head=T, fill=T), then the
data.frame in R will
2010 May 05
4
any function in R similar to the "scan" function in SAS?
I am wondering if there is any function in R that is similar to the "scan"
function in SAS.
I have a data.frame which has two columns as the following:
one two
1 2
3 4
5 6
I used the "paste" function to create the third column: three <-
paste(one,'-',two,sep="")
so the data.frame is like this now:
one two three
1 2 1-2
3
2011 Sep 20
1
A question regarding random effects in 'aov' function
Hi,
I am doing an analysis to see if these is tissue specific effects on the
gene expression data .
Our data were collected from 6 different labs (batch effects). lab 1 has
tissue type 1 and tissue type 2, lab 2 has tissue 3, 4,5,6. The other labs
has one tissue type each. The 'sample' data is as below:
2011 Jun 14
1
About 'hazard ratio', urgent~~~
Hi,
I am new to R.
My question is: how to get the 'hazard ratio' using the 'coxph' function in
'survival' package?
thanks,
karena
--
View this message in context: http://r.789695.n4.nabble.com/About-hazard-ratio-urgent-tp3595527p3595527.html
Sent from the R help mailing list archive at Nabble.com.
2011 May 20
1
How to do covariate adjustment in R
Hi, I have a question about how to do covariate adjustment.
I have two sets of 'gene expression' data. They are from two different
tissue types, 'liver' and 'brain', respectively.
The purpose of my analysis is to compare the pattern of the whole genome
'gene expression' between the two tissue types.
I have 'age' and 'sex' as covariates. Since
2011 Sep 15
1
Questions on 'lme' function, urgent!
Hi Dear all,
I have some gene expression data samples from different tissue types
-----------------------------------------------
- 120 samples from blood (B)
- 20 samples from Liver (L)
- 15 samples from Kidney (K)
- 6 samples from heart (H)
-----------------------------------------------
All the samples are from different individuals, so there are in total 161
individuals from which the DNA was