Displaying 20 results from an estimated 200 matches similar to: "about reading files in order"
2017 Jun 29
2
about reading files in order
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 below, I found that the txt files are not in order, from 1, 2, 3, to
200. Rather, they are in the
2017 Jun 29
0
about reading files in order
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 paste('folder01',lists[i],sep='/').
FYI 2; if you use
2017 Jun 29
1
about reading files in order
Thanks for that answer.
I was not aware of gtools::mixedsort
<https://www.rdocumentation.org/packages/gtools/versions/3.5.0/topics/mixedsort>
function.
Jean
On Thu, Jun 29, 2017 at 2:47 PM, Henrik Bengtsson <
henrik.bengtsson at gmail.com> wrote:
> You can use:
>
> > files <- list.files(path = "folder01")
> > files <- gtools::mixedsort(files)
>
2014 Jan 17
0
error while mount/access DFS share
Hi,
I'm having an error trying to read the contens of a DFS Share
The mount is:
sudo mount -t cifs -o username=mxxxxx ,uid=mxxxxx,gid=mxxxxx
//cluster_share/share /mnt
The share is mounted without errors, but when I try to list the share i
have this:
ls -la /mnt/folder
ls: cannot open directory /mnt/folder: Operation now in progress
and the syslog have the error reported
2014 May 28
0
RAILS IS FOR FAGGOTS WHO CANNOT USE TCL AND SHOULD QUIT LIFE FAGGOTS ANAL COCKSUCKING
TCL IS BETTER THAN RUBY. THIS MESSAGE WAS BROUGHT TO YOU BY
IRC.GANGNET.RU #TCLMAFIA SHOUTZ TO RYAN ETERNAL PRESIDENT OF GNAA,
MALCOM, FLUNITRAZEPAM, DUTCHMINATI, CRACK, SNITCH
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from
I am stopping the script because I am sleepy. irc.gangnet.ru #tclmafia RAILS SUCKS FAGGOTS ARE GROSS
2014 May 28
0
I am stopping the script because I am sleepy. irc.gangnet.ru #tclmafia RAILS SUCKS FAGGOTS ARE GROSS
TCL IS BETTER THAN RUBY. THIS MESSAGE WAS BROUGHT TO YOU BY
IRC.GANGNET.RU #TCLMAFIA SHOUTZ TO RYAN ETERNAL PRESIDENT OF GNAA,
MALCOM, FLUNITRAZEPAM, DUTCHMINATI, CRACK, SNITCH
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from
2014 May 28
0
TCL > RAILS YOU FAGGOTS
TCL IS BETTER THAN RUBY. THIS MESSAGE WAS BROUGHT TO YOU BY
IRC.GANGNET.RU #TCLMAFIA SHOUTZ TO RYAN ETERNAL PRESIDENT OF GNAA,
MALCOM, FLUNITRAZEPAM, DUTCHMINATI, CRACK, SNITCH
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from
2019 Nov 01
3
Getting error in rbindlist
Hi All
Can you help me understand the meaning of the below error message then I
will try to figure out what is going wrong:
*Input Code:*
> bodlane2 <- lapply(
+ lapply(split(lctolc2, lctolc2$Item), function(x) graph.data.frame(x[,
2:3])),
+ function(x) lapply(
+ V(x)[degree(x, mode = "in") == 0],
+ function(s) all_simple_paths(x, from = s,
+
2019 Nov 01
0
Getting error in rbindlist
On 11/1/19 5:24 PM, Anshul Saravgi wrote:
> Thanks Tomas for identifying the bug.
>
> *How to resolve this bug? Can you please help me here?*
I would recommend you first try to create a complete reproducible
example (the code below is just a snippet). Then try to minimize it -
make it do as little as possible but still trigger the bug. Then try to
reduce the number of packages used.
2013 Sep 18
1
rbinlist for data.table and specifying the column class
hello,
This
rbindlist(list(list(a=NA,b=NA),list(a=20,b=FALSE)))
returns
a b
1: NA NA
2: TRUE FALSE
as per the documentation ?rbindlist
is there a way to specify the column class of 'a' to be numeric?
In actual usage, i wont be able to re-order the 2nd list entry to be the
first.
I did try
2018 May 03
1
Converting a list to a data frame
This is very nice to learn about, Denis, but it seems only fair to point out that the result of rbindlist is not a data frame. You can convert it to a data frame easily, but the copy and indexing semantics of data tables are quite different than data tables, which could be a real headache for someone not prepared for those differences. (To learn more, read the data tables vignette.)
Tibbles (as
2018 May 02
0
Converting a list to a data frame
On 05/02/2018 07:11 PM, Kevin E. Thorpe wrote:
> I suspect this is pretty easy, but I'm having trouble figuring it out.
> Basically, I have a list of data frames such as the following example:
>
> list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8))
>
> I would like to turn this into data frame where the list elements are
> essentially rbind'ed together and
2017 Aug 06
2
about saving format
In the lower right panel of R-studio interface, there is the "Export"
button. I saved as PDF from there directly, rather than using functions
On Sat, Aug 5, 2017 at 6:18 PM, Ismail SEZEN <sezenismail at gmail.com> wrote:
>
> > On 6 Aug 2017, at 03:01, lily li <chocold12 at gmail.com> wrote:
> >
> > I am using the plot() function, but have a problem.
2018 Jan 16
1
Steps to create spatial plots
If layer$z is a matrix and you want to reverse the order of the rows, you
can do:
n <- nrow(layer$z)
layer$z <- layer$z[ n:1, ]
HTH,
Eric
On Tue, Jan 16, 2018 at 8:43 AM, lily li <chocold12 at gmail.com> wrote:
> Sorry for the emails, I just wanted to have an example.
> layer$z
>
> 1 1 3 4 6 2
> 2 3 4 1 2 9
> 1 4 5 2 1 8
>
> How to convert
2018 Jan 16
2
Steps to create spatial plots
Hi Bert,
I think you are correct that I can use levelplot, but I have a question
about converting data. For example, the statement:
levelplot(Z~X*Y), Z is row-wise from the lower left corner to the upper
right corner.
My dataset just have gridded Z data as a txt file (or can be called
matrix?), how to convert them to the vector in order for levelplot to use?
Thanks.
On Mon, Jan 15, 2018 at 6:04
2018 Jan 16
0
Steps to create spatial plots
Sorry for the emails, I just wanted to have an example.
layer$z
1 1 3 4 6 2
2 3 4 1 2 9
1 4 5 2 1 8
How to convert the matrix to layer$z = c(1, 4, 5, 2, 1, 8, 2, 3, 4, 1, 2,
9, 1, 1, 3, 4, 6, 2)?
I think this vector is the order that levelplot can use. Thanks again.
On Mon, Jan 15, 2018 at 10:58 PM, lily li <chocold12 at gmail.com> wrote:
> Hi Bert,
>
> I think
2017 Aug 06
0
about saving format
> On 6 Aug 2017, at 03:47, lily li <chocold12 at gmail.com> wrote:
>
> In the lower right panel of R-studio interface, there is the "Export" button. I saved as PDF from there directly, rather than using functions
>
> On Sat, Aug 5, 2017 at 6:18 PM, Ismail SEZEN <sezenismail at gmail.com> wrote:
>
> > On 6 Aug 2017, at 03:01, lily li <chocold12 at
2018 Mar 08
0
add single points to a level plot
Hi all,
I ran the code:
> s <- stack(replicate(2, raster(matrix(runif(100), 10))))
> xy <- data.frame(coordinates(sampleRandom(s, 10, sp=TRUE)),
+ z1=runif(10), z2=runif(10))
> levelplot(s, margin=FALSE, at=seq(0, 1, 0.05)) +
+ layer(sp.points(xy, pch=ifelse(pts$z1 < 0.5, 2, 3), cex=2, col=1),
columns=1) +
+ layer(sp.points(xy, pch=ifelse(pts$z2 < 0.5, 2,
2018 Mar 08
3
add single points to a level plot
Hi all,
I'm trying to add single points with known coordinates to a level plot, but
could not find the proper answer. I got to know that layer() function is
good for this, but I don't know which package is related to this function.
The source is here:
https://stackoverflow.com/questions/28597149/add-xy-points-to-raster-map-generated-by-levelplot
but my question is a little different as I
2017 Aug 06
2
about saving format
If the OP is using RStudio and not using R (i.e. pdf()) directly, it
sounds like this query should be directed to RStudio support, not
here.
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 Sat, Aug 5, 2017 at 5:54 PM, Ismail