Fix Ace
2017-May-23 17:27 UTC
[R] prcomp: Error in La.svd(x, nu, nv): error code 1 from Lapack routine "dgesdd"
Dear R community, I have a data matrix (531X314), and would like to apply the prcomp. However, I got this error Lapack message. I am using R3.2.2. I googled a bit and found that it might be related to converge issue. ?Just wonder if there is a way to get around it? Thank you very much! Ace On Thursday, December 29, 2016 11:44 AM, Ista Zahn <istazahn at gmail.com> wrote: Use coord_fixed() --Ista On Thu, Dec 29, 2016 at 9:59 AM, Fix Ace via R-help <r-help at r-project.org> wrote:> > > >? Hello, there, > What exactly does "expand" do for this function? > I followed the examples from the manual to get a plot: > > d <- ggplot(subset(diamonds, carat > 1), aes(cut, clarity)) +geom_jitter() > > I would like to have all the dots in a square instead of rectangular range. When I applied d + scale_x_discrete(expand=c(1,1)) and d + scale_x_discrete(expand=c(1,0)), I got the same plot (different from the original one though). > Could anyone help me to figure out how to use this argument? > Thank you very much! > Ace > > > > > >? ? ? ? [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]
Fix Ace
2017-Aug-27 20:25 UTC
[R] help with read.csv() for files with different number of columns
Dear R community, I have a text file (test.txt) with different number of columns: 0610007P14Rik%%% Tcf19 Gtf2i 0610010O12Rik%%% Ivns1abp Etv6 1100001G20Rik%%% Nmi 1500015O10Rik%%% Foxi1 Ascl3 Sirt3 1700003E16Rik%%% Ascl2 Ifnar2 1700028J19Rik%%% Musk Nfe2l3 1810011O10Rik%%% Ppp1r13b Bpnt1 Cdkn2c Foxc1 Sox10 Smarca2 1810019D21Rik%%% Asb8 1810037I17Rik%%% Zfp612 1810055G02Rik%%% Nkx2-3 Maged1 Runx1 Ugp2 Elk4 Spdef Tcf19 Isl2 Gtf2i Ctnnbl1 Tcea3 Ank2 Zfp612 Creb3l1 Nupr1 3632451O06Rik Creb3l4 Lass6 I wold like to read it into R using > test=read.csv("test.txt",sep="\t",header=FALSE) However, when I check the r object "test", I found that all the rows have 5 columns:> test?? ? ? ? ? ? ? ? V1? ? ? ? ? ? V2? ? ? V3 ? ? V4? ? ? V51? 0610007P14Rik%%% ? ? ? ? Tcf19 ? Gtf2i? ? ? ? ? ? ? ?2? 0610010O12Rik%%%? ? ? Ivns1abp? ? Etv6? ? ? ? ? ? ? ?3? 1100001G20Rik%%% ? ? ? ? ? Nmi? ? ? ? ? ? ? ? ? ? ? ?4? 1500015O10Rik%%% ? ? ? ? Foxi1 ? Ascl3? Sirt3 ? ? ? ?5? 1700003E16Rik%%% ? ? ? ? Ascl2? Ifnar2? ? ? ? ? ? ? ?6? 1700028J19Rik%%%? ? ? ? ? Musk? Nfe2l3? ? ? ? ? ? ? ?7? 1810011O10Rik%%%? ? ? Ppp1r13b ? Bpnt1 Cdkn2c ? Foxc18 ? ? ? ? ? ? Sox10 ? ? ? Smarca2? ? ? ? ? ? ? ? ? ? ? ?9? 1810019D21Rik%%%? ? ? ? ? Asb8? ? ? ? ? ? ? ? ? ? ? ?10 1810037I17Rik%%%? ? ? ? Zfp612? ? ? ? ? ? ? ? ? ? ? ?11 1810055G02Rik%%%? ? ? ? Nkx2-3? Maged1? Runx1? ? Ugp212 ? ? ? ? ? ? Elk4 ? ? ? ? Spdef ? Tcf19 ? Isl2 ? Gtf2i13? ? ? ? ? Ctnnbl1 ? ? ? ? Tcea3? ? Ank2 Zfp612 Creb3l114? ? ? ? ? ? Nupr1 3632451O06Rik Creb3l4? Lass6?Basically it breaks some rows into more than one rows. For example, row 7 in the original record becomes two rows. Looks like the "test" always has 5 columns.? How does this happen? How should I fix it to make one record into one two in R object? Thank you very much! Ace [[alternative HTML version deleted]]
Bert Gunter
2017-Aug-27 23:04 UTC
[R] help with read.csv() for files with different number of columns
Email a mess. Too hard for me to decipher, maybe also for others. If no response, send plain text, as requested by posting guide. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, Aug 27, 2017 at 1:25 PM, Fix Ace via R-help <r-help at r-project.org> wrote:> Dear R community, > I have a text file (test.txt) with different number of columns: > 0610007P14Rik%%% Tcf19 Gtf2i 0610010O12Rik%%% Ivns1abp Etv6 1100001G20Rik%%% Nmi 1500015O10Rik%%% Foxi1 Ascl3 Sirt3 1700003E16Rik%%% Ascl2 Ifnar2 1700028J19Rik%%% Musk Nfe2l3 1810011O10Rik%%% Ppp1r13b Bpnt1 Cdkn2c Foxc1 Sox10 Smarca2 1810019D21Rik%%% Asb8 1810037I17Rik%%% Zfp612 1810055G02Rik%%% Nkx2-3 Maged1 Runx1 Ugp2 Elk4 Spdef Tcf19 Isl2 Gtf2i Ctnnbl1 Tcea3 Ank2 Zfp612 Creb3l1 Nupr1 3632451O06Rik Creb3l4 Lass6 > I wold like to read it into R using > > test=read.csv("test.txt",sep="\t",header=FALSE) > However, when I check the r object "test", I found that all the rows have 5 columns: >> test V1 V2 V3 V4 V51 0610007P14Rik%%% Tcf19 Gtf2i 2 0610010O12Rik%%% Ivns1abp Etv6 3 1100001G20Rik%%% Nmi 4 1500015O10Rik%%% Foxi1 Ascl3 Sirt3 5 1700003E16Rik%%% Ascl2 Ifnar2 6 1700028J19Rik%%% Musk Nfe2l3 7 1810011O10Rik%%% Ppp1r13b Bpnt1 Cdkn2c Foxc18 Sox10 Smarca2 9 1810019D21Rik%%% Asb8 10 1810037I17Rik%%% Zfp612 11 1810055G02Rik%%% Nkx2-3 Maged1 Runx1 Ugp212 Elk4 Spdef Tcf19 Isl2 Gtf2i13 Ctnnbl1 Tcea3 Ank2 Zfp612 Creb3l114 Nupr1 3632451O06Rik Creb3l4 Lass6 > Basically it breaks some rows into more than one rows. For example, row 7 in the original record becomes two rows. Looks like the "test" always has 5 columns. > How does this happen? How should I fix it to make one record into one two in R object? > Thank you very much! > Ace > > > > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Jim Lemon
2017-Aug-27 23:25 UTC
[R] help with read.csv() for files with different number of columns
Hi Ace, As your example seems to have spaces as separators, testdf<-read.table("test.txt",header=FALSE,fill=TRUE, col.names=paste("V",1:14,sep=""),stringsAsFactors=FALSE) By specifying the number of columns with "col.names" and using "fill=TRUE" you can get a data frame with zero length strings where values are missing in the input file. Jim On Mon, Aug 28, 2017 at 6:25 AM, Fix Ace via R-help <r-help at r-project.org> wrote:> Dear R community, > I have a text file (test.txt) with different number of columns: > 0610007P14Rik%%% Tcf19 Gtf2i 0610010O12Rik%%% Ivns1abp Etv6 1100001G20Rik%%% Nmi 1500015O10Rik%%% Foxi1 Ascl3 Sirt3 1700003E16Rik%%% Ascl2 Ifnar2 1700028J19Rik%%% Musk Nfe2l3 1810011O10Rik%%% Ppp1r13b Bpnt1 Cdkn2c Foxc1 Sox10 Smarca2 1810019D21Rik%%% Asb8 1810037I17Rik%%% Zfp612 1810055G02Rik%%% Nkx2-3 Maged1 Runx1 Ugp2 Elk4 Spdef Tcf19 Isl2 Gtf2i Ctnnbl1 Tcea3 Ank2 Zfp612 Creb3l1 Nupr1 3632451O06Rik Creb3l4 Lass6 > I wold like to read it into R using > > test=read.csv("test.txt",sep="\t",header=FALSE) > However, when I check the r object "test", I found that all the rows have 5 columns: >> test V1 V2 V3 V4 V51 0610007P14Rik%%% Tcf19 Gtf2i 2 0610010O12Rik%%% Ivns1abp Etv6 3 1100001G20Rik%%% Nmi 4 1500015O10Rik%%% Foxi1 Ascl3 Sirt3 5 1700003E16Rik%%% Ascl2 Ifnar2 6 1700028J19Rik%%% Musk Nfe2l3 7 1810011O10Rik%%% Ppp1r13b Bpnt1 Cdkn2c Foxc18 Sox10 Smarca2 9 1810019D21Rik%%% Asb8 10 1810037I17Rik%%% Zfp612 11 1810055G02Rik%%% Nkx2-3 Maged1 Runx1 Ugp212 Elk4 Spdef Tcf19 Isl2 Gtf2i13 Ctnnbl1 Tcea3 Ank2 Zfp612 Creb3l114 Nupr1 3632451O06Rik Creb3l4 Lass6 > Basically it breaks some rows into more than one rows. For example, row 7 in the original record becomes two rows. Looks like the "test" always has 5 columns. > How does this happen? How should I fix it to make one record into one two in R object? > Thank you very much! > Ace > > > > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Seemingly Similar Threads
- help with read.csv() for files with different number of columns
- help with read.csv() for files with different number of columns
- help with read.csv() for files with different number of columns
- help with read.csv() for files with different number of columns
- help with read.csv() for files with different number of columns