Re: [R] about reading files in order

2017-06-30 Thread Jeff Newmiller
See http://en.wikipedia.org/wiki/Internet_troll -- Sent from my phone. Please excuse my brevity. On June 30, 2017 10:50:45 AM EDT, lily li wrote: >Who is this person and what did he/she mean? > >On Fri, Jun 30, 2017 at 1:48 AM, Kindell Young >wrote: >

Re: [R] about reading files in order

2017-06-30 Thread lily li
Who is this person and what did he/she mean? On Fri, Jun 30, 2017 at 1:48 AM, Kindell Young wrote: > > On Jun 29, Silly FAGGOTS DICKS [R] 4 chicks not 18-40 year old dudes with > no life or reason too still live except wasting our worlds oxygen on > pathetic excuses of

Re: [R] about reading files in order

2017-06-29 Thread lily li
Thanks also. On Thu, Jun 29, 2017 at 2:12 PM, Adams, Jean wrote: > Thanks for that answer. > I was not aware of gtools::mixedsort > > function. > > Jean > > On Thu, Jun 29, 2017 at 2:47 PM, Henrik

Re: [R] about reading files in order

2017-06-29 Thread Adams, Jean
Thanks for that answer. I was not aware of gtools::mixedsort function. Jean On Thu, Jun 29, 2017 at 2:47 PM, Henrik Bengtsson < henrik.bengts...@gmail.com> wrote: > You can use: > > > files <- list.files(path =

Re: [R] about reading files in order

2017-06-29 Thread Henrik Bengtsson
You can use: > files <- list.files(path = "folder01") > files <- gtools::mixedsort(files) to order the files in a "human-friendly" order rather than lexicographic order (which sort() provides). FYI 1; it's preferred to use file.path("folder01", list[i]) rather than

[R] about reading files in order

2017-06-29 Thread lily li
Hi R users, I have a question about opening the txt files and putting them into a matrix. The txt files are in the folder01, while they have the name file.1.txt, file.2.txt, file.3.txt, etc. There are about 200 such text files. Each txt file contains one value inside. When I tried to use the code