[R] Beginner needs help with R
dusa.adrian at unibuc.ro
Mon Feb 6 15:42:53 CET 2017
Two methods, among others:
seq1 <- paste("DQ", sprintf("%0*d", 6, seq(060054, 060060)), sep = "")
seq1 <- paste("DQ", formatC(seq(060054, 060060), dig = 5, flag = 0), sep =
On Mon, Feb 6, 2017 at 3:50 AM, Nabila Arbi <nabilaelarbi1912 at gmail.com>
> Dear R-Help Team!
> I have some trouble with R. It's probably nothing big, but I can't find a
> My problem is the following:
> I am trying to download some sequences from ncbi using the ape package.
> seq1 <- paste("DQ", seq(060054, 060060), sep = "")
> sequences <- read.GenBank(seq1,
> seq.names = seq1,
> species.names = TRUE,
> gene.names = FALSE,
> as.character = TRUE)
> write.dna(sequences, "mysequences.fas", format = "fasta")
> My problem is, that R doesn't take the whole sequence number as "060054"
> but it puts it as DQ60054 (missing the zero in the beginning, which is
> Could please tell me, how I can get R to accepting the zero in the
> beginning of the accession number?
> Thank you very much in advance and all the best!
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/
> and provide commented, minimal, self-contained, reproducible code.
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr. 90-92
050663 Bucharest sector 5
[[alternative HTML version deleted]]
More information about the R-help