[R] PCA on SNP genotypes

2016-03-03 Thread Mohsen Jafarikia
Hello everyone: I have about a couple of thousands of samples each with about 100 SNP genotypes and I would like to do PCA using genotypes. I looked on the web and found different options available on R for PCA. I was wondering if I could have advice about the program fits better what I am trying

Re: [R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Mohsen Jafarikia
gument or used explicit values for ylim= in the first > plot, then propagated the error by copying and pasting. > > Jim > > On Thu, Jan 21, 2016 at 8:56 AM, Mohsen Jafarikia > wrote: >> >> Thanks very much for the comment. >> >> I was also wondering why all the y-

Re: [R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Mohsen Jafarikia
graphs. Regards, Mohsen On Wed, Jan 20, 2016 at 4:27 PM, Sarah Goslee wrote: > Use a device like pdf() or postscript() that supports multiple pages. > Or start a new default device with dev.new() so you can see two > figures simultaneously. > > Sarah > > On Wed, Jan 20, 20

[R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Mohsen Jafarikia
Hello everyone: I have 12 plots that I am using par(mfrow=c(3,2)) to have 6 of them in a single page. R only prints the 6 first graph in a single page. Any comments how I can ask R to print all 12 graphs in two pages. Thanks very much, Mohsen __ R-help

[R] write.xlsx- writing in a single sheet

2016-01-15 Thread Mohsen Jafarikia
Hello all: I am having problem writing a few files in a single sheet of excel. It seems R has problem writing on the same sheet. Maybe there is a command that I am missing. Here is the code I am using: library(xlsx) ifn11 <- "A1.xlsx" dat11 <- read.xlsx(ifn11, sheetName="A.csv", header = TRUE)

Re: [R] read.xlsx - write.xlsx: reading/writing numbers as character

2016-01-14 Thread Mohsen Jafarikia
roblem is. > > > Sent from my Verizon Wireless 4G LTE Smartphone > > > Original message > From: Mohsen Jafarikia > Date:01/14/2016 11:36 (GMT-05:00) > To: jim holtman > Cc: r-help > Subject: Re: [R] read.xlsx - write.xlsx: reading/writing numbers as

Re: [R] read.xlsx - write.xlsx: reading/writing numbers as character

2016-01-14 Thread Mohsen Jafarikia
--- Original message > From: Mohsen Jafarikia > Date:01/14/2016 11:36 (GMT-05:00) > To: jim holtman > Cc: r-help > Subject: Re: [R] read.xlsx - write.xlsx: reading/writing numbers as > character > > Thanks for the comment Jim. There is no blank cell. All have numbers. >

Re: [R] read.xlsx - write.xlsx: reading/writing numbers as character

2016-01-14 Thread Mohsen Jafarikia
L might > not be.​ > > > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. > > On Thu, Jan 14, 2016 at 11:20 AM, Mohsen Jafarikia > wrote: > >> Hello: >> >

[R] read.xlsx - write.xlsx: reading/writing numbers as character

2016-01-14 Thread Mohsen Jafarikia
Hello: I am reading some excel files (each with one sheet) and trying to write them all in one file. I am not sure if read.xlsx reads some of the columns as character or write.xlsx writes them as character where they are not characters. I have 12 columns (2 character and 10 numbers). From 10 numbe

Re: [R] Multiple CSV files in different sheets of an Excel file

2016-01-13 Thread Mohsen Jafarikia
an 13, 2016 at 9:53 AM, Frans Marcelissen < fransiepansiekever...@gmail.com> wrote: > Hi Mohsen, > Just read them with read.csv or read.table (file1<-read.csv(file=.), > and you can write them. > Success! > Frams > > 2016-01-13 15:47 GMT+01:00 Mohsen Jafarikia : > &

Re: [R] Multiple CSV files in different sheets of an Excel file

2016-01-13 Thread Mohsen Jafarikia
hat with the append parameter of the write.xlsx routine in the > xlsx package: > > xlsx::write.xlsx(file1,file='X.xlsx',sheetName = '1') > xlsx::write.xlsx(file2,file='X.xlsx',sheetName = '2',append = T) > > Success! > Frans > &g

[R] Multiple CSV files in different sheets of an Excel file

2016-01-13 Thread Mohsen Jafarikia
I have multiple CSV files that I would like to have them in a single Excel file. For example, I have file1.csv and file2.csv and I want to have file.xls where file1.csv and file2.csv each have been copied to a single sheet of the file.xls file. Thanks, Mohsen [[alternative HTML version de

[R] mhtplot?

2010-10-01 Thread Mohsen Jafarikia
Hello All: I was wondering why many plot options are not working with mhtplot. I could not find much info about this function on the web too. Any comments, any detailed manual ... Thanks, MJK [[alternative HTML version deleted]] __ R-help@r-pr

[R] graph margins

2010-09-29 Thread Mohsen Jafarikia
Hello All, I am drawing a graph having 18 small graphs inside using par(mfrow = c(6,3)) command. My problem is how to specify the margins of the whole 18 graphs. I used par(mar=c(6.5, 6.5, 1.5, 1.5)) for each graph separately already but it does not left any margins for the 'mtext()' for the margi

[R] ESP Ghostscrip ...

2010-05-13 Thread Mohsen Jafarikia
Hello All: Could anybody tell me please what is the meaning of this error message: ESP Ghostscript 815.02: Unrecoverable error, exit code 1 Error in plot.xy(xy, type, ...) : ignoring SIGPIPE signal Calls: plot -> plot.default -> plot.xy Execution halted My code has to go to 18 loops for three ti

[R] plot error

2010-05-13 Thread Mohsen Jafarikia
Hello All: I am having the following error message when I increase the resolution ("res=30" to "res=350") of my graph: Error in plot.xy(xy, type, ...) : ignoring SIGPIPE signal Calls: plot -> plot.default -> plot.xy Execution halted Here is the code: ofn <- "MAY11.png" bitmap(ofn, type = "png25

[R] plot error

2010-05-12 Thread Mohsen Jafarikia
Hello All: I am having the following error message when I increase the resolution ("res=30" to "res=350") of my graph: Error in plot.xy(xy, type, ...) : ignoring SIGPIPE signal Calls: plot -> plot.default -> plot.xy Execution halted Here is the code: ofn <- "MAY11.png" bitmap(ofn, type = "png25

[R] array question

2010-02-17 Thread Mohsen Jafarikia
Hello All: If I do have: x = (2, 4, 5, 5, 6, 4, 5, 2, 1) y = (9, 11.5, 12.5, 13, 14, 19, 20, 21, 22) I wanted to find a simple function in R which calculates the averages of X and Y for every 4 unit increase of Y. The results should look like: x = (4, 6, 3) #where (2+ 4+ 5+ 5)/ 4

[R] Y average in plot

2010-02-12 Thread Mohsen Jafarikia
Hello All: Can somebody please tell me how I can have the average of 'y' on the graph for different values of 'x in the following code? ofn <- "xy.png" bitmap(ofn, type = "png256", width = 21, height = 30, pointsize = 30, bg = "white",res=50) ifn <- sprintf("xy.txt") data <- read.table(ifn)

[R] vector to diagonals

2010-01-07 Thread Mohsen Jafarikia
> > Hello All: > > Can somebody tell me how to make a diagonal matrix from a vector please? > > if X is > 1 > 2 > 3 > > I need: > 1 0 0 > 0 2 0 > 0 0 3 > > Thanks alot, > Mohsen > [[alternative HTML version deleted]] __ R-help@r-project.org mail

[R] reading a string

2009-08-13 Thread Mohsen Jafarikia
Hello All: I am having the following data file named "data.dat" Number of people Number of pets Age of trees ifn <- "data.dat" dat <- read.table(ifn) colnames(dat)<-c("Variables") I want R to read all these in a string but when I ask R to read these, it gives me error because there more than

[R] Ylim

2009-08-06 Thread Mohsen Jafarikia
Hello All: Can anybody tell me what is the problem with my program please. I have an error message as appears below. My program is: ifn <- "Jul08_09.LM" data <- read.table(ifn) ofn <- "Jul.png" bitmap(ofn, type = "png256", width = 30, height = 30, pointsize = 30, bg = "white",res=50) par(mar=c(

[R] string

2009-07-31 Thread Mohsen Jafarikia
Hello All: I am wondering how I can have "dat1" and "dat2" in the following loop where 'dat' and 'i' stick together to make dat1 and dat2 : ifn <- "MyData" dat <- read.table(ifn) MyData: 01 0.40 02 0.40 03 0.40 04 0.35 05 0.34 06 0.33 names(d

[R] string

2009-07-31 Thread Mohsen Jafarikia
Hello All: I am wondering how I can have "dat1" and "dat2" in the following loop where 'dat' and 'i' stick together to make dat1 and dat2 : ifn <- "MyData" dat <- read.table(ifn) MyData: 01 0.40 02 0.40 03 0.40 04 0.35 05 0.34 06 0.33 names(d

[R] string

2009-07-31 Thread Mohsen Jafarikia
Hello All: I am wondering how I can have "dat1" and "dat2" in the following loop where 'dat' and 'i' stick together to make dat1 and dat2 : ifn <- "MyData" dat <- read.table(ifn) MyData: 01 0.40 02 0.40 03 0.40 04 0.35 05 0.34 06 0.33 names(d

[R] reading a file

2009-07-30 Thread Mohsen Jafarikia
Hello there, I have the following info in MyData: 01 0.40 02 0.40 03 0.40 04 0.35 05 0.34 06 0.33 I want to read them using the following code: ifn <- "MyData" dat <- read.table(ifn) names(dat1)<-c("Code","M") names(dat2)<-c("Code","M") I w

[R] numbers on barplot

2009-07-27 Thread Mohsen Jafarikia
Hello all, I have this simple barplot code: ifn <- "id.dat" dat <- read.table(ifn) ofn <- "id.png" bitmap(ofn, type = "png256", width = 30, height = 30, pointsize = 30, bg = "white",res=50) par(mar=c(5, 5, 3, 2),lwd=5) par(cex.main=1.6,cex.lab=1.6,cex.axis=1.6) names(dat)<-c("NumberOfPeople","Av