Re: [R] Question about Rfast colMins and colMaxs

2021-12-03 Thread Stephen H. Dawson, DSL via R-help

Thanks, Richard.

I am researching other library options for data inspection. I have many 
csv files I am reviewing with different column names and data types. 
Flexibility of a quick review of max and min is quite valuable at this 
juncture.


I will implement your code recommendation next week and see how it performs.


Kindest Regards,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 12/2/21 11:06 PM, Richard O'Keefe wrote:

What puzzles me is why you are not just using
lapply(some.data.frame, min)
lapply(some.data.frame, max)
or as.vector(lapply(...))
Why go to another package for this?
Is it the indices you want?

col.min.indices <- function (some.data.frame) {
    v <- sapply(some.data.frame, function (column)
which(column == min(column))[1])
    names(v) <- colnames(some.data.frame)
    v
}


On Wed, 1 Dec 2021 at 07:55, Stephen H. Dawson, DSL via R-help 
mailto:r-help@r-project.org>> wrote:


Hi,


I am working to understand the Rfast functions of colMins and
colMaxs. I
worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html


https://cran.r-project.org/web/packages/Rfast/Rfast.pdf


My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF
saying I
need to bring data into R using a matrix. I think read.csv brings the
data in as a dataframe. I think colMins is failing because it is
looking
for a matrix but finds a dataframe.

 > colMaxs(Data)
Error in colMaxs(Data) :
   Not compatible with requested type: [type=list; target=double].
 > colMins(Data, na.rm = TRUE)
Error in colMins(Data, na.rm = TRUE) :
   unused argument (na.rm = TRUE)
 > colMins(Data, value = FALSE, parallel = FALSE)
Error in colMins(Data, value = FALSE, parallel = FALSE) :
   Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it
can be
accessed by colMaxs and colMins, please?


Thanks,
-- 
*Stephen Dawson, DSL*

/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 
>

__
R-help@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.



__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-12-02 Thread Richard O'Keefe
What puzzles me is why you are not just using
lapply(some.data.frame, min)
lapply(some.data.frame, max)
or as.vector(lapply(...))
Why go to another package for this?
Is it the indices you want?

col.min.indices <- function (some.data.frame) {
v <- sapply(some.data.frame, function (column)
   which(column == min(column))[1])
names(v) <- colnames(some.data.frame)
v
}


On Wed, 1 Dec 2021 at 07:55, Stephen H. Dawson, DSL via R-help <
r-help@r-project.org> wrote:

> Hi,
>
>
> I am working to understand the Rfast functions of colMins and colMaxs. I
> worked through the example listed on page 54 of the PDF.
>
> https://cran.r-project.org/web/packages/Rfast/index.html
>
> https://cran.r-project.org/web/packages/Rfast/Rfast.pdf
>
> My data is in a CSV file. So, I bring it into R Studio using:
> Data <- read.csv("./input/DataSet05.csv", header=T)
>
> However, I read the instructions listed on page 54 of the PDF saying I
> need to bring data into R using a matrix. I think read.csv brings the
> data in as a dataframe. I think colMins is failing because it is looking
> for a matrix but finds a dataframe.
>
>  > colMaxs(Data)
> Error in colMaxs(Data) :
>Not compatible with requested type: [type=list; target=double].
>  > colMins(Data, na.rm = TRUE)
> Error in colMins(Data, na.rm = TRUE) :
>unused argument (na.rm = TRUE)
>  > colMins(Data, value = FALSE, parallel = FALSE)
> Error in colMins(Data, value = FALSE, parallel = FALSE) :
>Not compatible with requested type: [type=list; target=double].
>
> QUESTION
> What is the best practice to bring a csv file into R Studio so it can be
> accessed by colMaxs and colMins, please?
>
>
> Thanks,
> --
> *Stephen Dawson, DSL*
> /Executive Strategy Consultant/
> Business & Technology
> +1 (865) 804-3454
> http://www.shdawson.com 
>
> __
> R-help@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]]

__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-12-02 Thread Stephen H. Dawson, DSL via R-help
he purpose here is not that broad.

But since I use some packages like the tidyverse extensively, and I am far

>from alone, I wonder if someday the powers that be realize it is a losing

battle to exclude at least some of it. It would be so nice not having to
include a long list of packages for some programs or somehow arrange that
people using something you shared had installed and loaded them. But there
are too many packages out there of varying quality and usefulness and
popularity with more every day being added. Worse, many are somewhat
incompatible such as having functions with the same names that hide earlier
ones loaded.

Base R doe come with functions like colSums and colMeans and similar row
functions. But as mentioned, a data.frame is a list of vectors and R
supports certain functional programming constructs over lists using things
like:

lapply(df, min)
sapply(df, min)

And actually quite a few ways depending on what info you want back and
whether you insist it be returned as a list or vector or other things . You
can even supply additional arguments that might be needed such as if you
want to ignore any NA values,

lapply(df, min, na.rm=TRUE

The package you looked at it is trying to be fast and uses what looks like
compiled external code but so does lapply.

If this is too bothersome for you, consider making a one-liner function like
this:

mycolMins <- function(df, ...) lapply(df, min, ...)

Once defined, you can use that just fine and not think about it again and I
note this answer (like others) is offering you something in base R that
works fine on data.frames and the like.

You can extend to many similar ideas like this one that calulates the min
unless you over-ride it with max or mean or sd or a bizarre function like
`[` so a call to:

mycolCalc(df, `[`, 3)

Will return exactly the third items in each row!

I find it to be very common for someone these days to do a quick search for
a way to do something in a language like R and not really look to see if it
is a standard way or something special/ Matrices in R are not quite the same
as some other objects like a data.frame or tibble and a package written to
be used on one may (or may not) happen to work with another. Some packages
are carefully written to try to detect what kind of object it gets and when
possible convert it to another. The "apply" function is meant for matrices
but if it sees something else it looks ta the dimensionality and tries to
coerce it with as.matrix or as.array first. As others have noted, this mean
a data.frame containing non-numeric parts may fail or should have any other
columns hidden/removed as in this df that has some non-numeric fields:


df

i   s   f b i2
1 1   hello 1.2  TRUE  5
2 2   there 2.3 FALSE  4
3 3 goodbye 3.4  TRUE  3

So a bit more complex one-liner removes any non-numeric columns like this:


mycolMins(df[, sapply(df, is.numeric)])

$i
[1] 1

$f
[1] 1.2

$i2
[1] 3

Clearly converting that to a matrix while whole would result in everything
being converted to character and a minimum may be elusive.

-Original Message-
From: R-help  On Behalf Of Stephen H. Dawson,
DSL via R-help
Sent: Tuesday, November 30, 2021 5:37 PM
To: Bert Gunter 
Cc: r-help@r-project.org
Subject: Re: [R] Question about Rfast colMins and colMaxs

Oh, you are segmenting standard R from the rest of R.

Well, that part did not come across to me in your original reply. I am not
clear on a standard versus non-standard list. I will look into this aspect
and see what I can learn going forward.


Thanks,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 5:26 PM, Bert Gunter wrote:

... but Rfast is *not* a "standard" package, as the rest of the PG
excerpt says. So contact the maintainer and ask him/her what they
think the best practice should be for their package. As has been
pointed out already, it appears to differ from the usual "read it in
as a data frame" procedure.

Bert

On Tue, Nov 30, 2021 at 2:11 PM Stephen H. Dawson, DSL
 wrote:

Right, R Studio is not R.

However, the Rfast package is part of R.

https://cran.r-project.org/web/packages/Rfast/index.html

So, rephrasing my question...
What is the best practice to bring a csv file into R so it can be
accessed by colMaxs and colMins, please?

*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 3:19 PM, Bert Gunter wrote:

RStudio is **not** R. In particular, the so-called TidyVerse
consists of all *non*-standard contributed packages, about which the PG

says:

"For questions about functions in standard packages distributed with
R (see the FAQ Add-on packages in R), ask questions on R-help.
[The link is:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
This gives the list of cu

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread Bert Gunter
ons about all kinds of
> >add-on packages and in particular, lots of the ones in the tidyverse.
> >Clearly the purpose here is not that broad.
> >
> >But since I use some packages like the tidyverse extensively, and I am far
> >from alone, I wonder if someday the powers that be realize it is a losing
> >battle to exclude at least some of it. It would be so nice not having to
> >include a long list of packages for some programs or somehow arrange that
> >people using something you shared had installed and loaded them. But there
> >are too many packages out there of varying quality and usefulness and
> >popularity with more every day being added. Worse, many are somewhat
> >incompatible such as having functions with the same names that hide earlier
> >ones loaded.
> >
> >Base R doe come with functions like colSums and colMeans and similar row
> >functions. But as mentioned, a data.frame is a list of vectors and R
> >supports certain functional programming constructs over lists using things
> >like:
> >
> >lapply(df, min)
> >sapply(df, min)
> >
> >And actually quite a few ways depending on what info you want back and
> >whether you insist it be returned as a list or vector or other things . You
> >can even supply additional arguments that might be needed such as if you
> >want to ignore any NA values,
> >
> >lapply(df, min, na.rm=TRUE
> >
> >The package you looked at it is trying to be fast and uses what looks like
> >compiled external code but so does lapply.
> >
> >If this is too bothersome for you, consider making a one-liner function like
> >this:
> >
> >mycolMins <- function(df, ...) lapply(df, min, ...)
> >
> >Once defined, you can use that just fine and not think about it again and I
> >note this answer (like others) is offering you something in base R that
> >works fine on data.frames and the like.
> >
> >You can extend to many similar ideas like this one that calulates the min
> >unless you over-ride it with max or mean or sd or a bizarre function like
> >`[` so a call to:
> >
> >mycolCalc(df, `[`, 3)
> >
> >Will return exactly the third items in each row!
> >
> >I find it to be very common for someone these days to do a quick search for
> >a way to do something in a language like R and not really look to see if it
> >is a standard way or something special/ Matrices in R are not quite the same
> >as some other objects like a data.frame or tibble and a package written to
> >be used on one may (or may not) happen to work with another. Some packages
> >are carefully written to try to detect what kind of object it gets and when
> >possible convert it to another. The "apply" function is meant for matrices
> >but if it sees something else it looks ta the dimensionality and tries to
> >coerce it with as.matrix or as.array first. As others have noted, this mean
> >a data.frame containing non-numeric parts may fail or should have any other
> >columns hidden/removed as in this df that has some non-numeric fields:
> >
> >> df
> >i   s   f b i2
> >1 1   hello 1.2  TRUE  5
> >2 2   there 2.3 FALSE  4
> >3 3 goodbye 3.4  TRUE  3
> >
> >So a bit more complex one-liner removes any non-numeric columns like this:
> >
> >> mycolMins(df[, sapply(df, is.numeric)])
> >$i
> >[1] 1
> >
> >$f
> >[1] 1.2
> >
> >$i2
> >[1] 3
> >
> >Clearly converting that to a matrix while whole would result in everything
> >being converted to character and a minimum may be elusive.
> >
> >-Original Message-
> >From: R-help  On Behalf Of Stephen H. Dawson,
> >DSL via R-help
> >Sent: Tuesday, November 30, 2021 5:37 PM
> >To: Bert Gunter 
> >Cc: r-help@r-project.org
> >Subject: Re: [R] Question about Rfast colMins and colMaxs
> >
> >Oh, you are segmenting standard R from the rest of R.
> >
> >Well, that part did not come across to me in your original reply. I am not
> >clear on a standard versus non-standard list. I will look into this aspect
> >and see what I can learn going forward.
> >
> >
> >Thanks,
> >*Stephen Dawson, DSL*
> >/Executive Strategy Consultant/
> >Business & Technology
> >+1 (865) 804-3454
> >http://www.shdawson.com <http://www.shdawson.com>
> >
> >
> >On 11/30/21 5:26 PM, Bert Gunter wrote:
> >> ... but Rfast is *not* a "standard" package, as the rest of the PG
> >> excerpt says. So contact the maintainer and ask him/her what they
> 

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread Stephen H. Dawson, DSL via R-help

Thanks, Avi.

Yes, loading packages by library command is necessary to access a 
function not resident in the standard R code.


The data set I am reviewing has column names changing. The thought is to 
do a review of max and min for whatever the column names happen to be 
for the data input I am reviewing.



*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 10:42 PM, Avi Gross via R-help wrote:

Stephen,

Although what is in the STANDARD R distribution can vary several ways, in
general, if you need to add a line like:

library(something)
or
require(something)

and your code does not work unless you have done that, then you can imagine
it is not sort of built in to R as it starts.

Having said that, tons of exceptions may exist that cause R to load in
things on your machine for everyone or just for you without you having to
notice.

I think this forum lately has been deluged with questions about all kinds of
add-on packages and in particular, lots of the ones in the tidyverse.
Clearly the purpose here is not that broad.

But since I use some packages like the tidyverse extensively, and I am far
from alone, I wonder if someday the powers that be realize it is a losing
battle to exclude at least some of it. It would be so nice not having to
include a long list of packages for some programs or somehow arrange that
people using something you shared had installed and loaded them. But there
are too many packages out there of varying quality and usefulness and
popularity with more every day being added. Worse, many are somewhat
incompatible such as having functions with the same names that hide earlier
ones loaded.

Base R doe come with functions like colSums and colMeans and similar row
functions. But as mentioned, a data.frame is a list of vectors and R
supports certain functional programming constructs over lists using things
like:

lapply(df, min)
sapply(df, min)

And actually quite a few ways depending on what info you want back and
whether you insist it be returned as a list or vector or other things . You
can even supply additional arguments that might be needed such as if you
want to ignore any NA values,

lapply(df, min, na.rm=TRUE

The package you looked at it is trying to be fast and uses what looks like
compiled external code but so does lapply.

If this is too bothersome for you, consider making a one-liner function like
this:

mycolMins <- function(df, ...) lapply(df, min, ...)

Once defined, you can use that just fine and not think about it again and I
note this answer (like others) is offering you something in base R that
works fine on data.frames and the like.

You can extend to many similar ideas like this one that calulates the min
unless you over-ride it with max or mean or sd or a bizarre function like
`[` so a call to:

mycolCalc(df, `[`, 3)

Will return exactly the third items in each row!

I find it to be very common for someone these days to do a quick search for
a way to do something in a language like R and not really look to see if it
is a standard way or something special/ Matrices in R are not quite the same
as some other objects like a data.frame or tibble and a package written to
be used on one may (or may not) happen to work with another. Some packages
are carefully written to try to detect what kind of object it gets and when
possible convert it to another. The "apply" function is meant for matrices
but if it sees something else it looks ta the dimensionality and tries to
coerce it with as.matrix or as.array first. As others have noted, this mean
a data.frame containing non-numeric parts may fail or should have any other
columns hidden/removed as in this df that has some non-numeric fields:


df

i   s   f b i2
1 1   hello 1.2  TRUE  5
2 2   there 2.3 FALSE  4
3 3 goodbye 3.4  TRUE  3

So a bit more complex one-liner removes any non-numeric columns like this:


mycolMins(df[, sapply(df, is.numeric)])

$i
[1] 1

$f
[1] 1.2

$i2
[1] 3

Clearly converting that to a matrix while whole would result in everything
being converted to character and a minimum may be elusive.

-Original Message-
From: R-help  On Behalf Of Stephen H. Dawson,
DSL via R-help
Sent: Tuesday, November 30, 2021 5:37 PM
To: Bert Gunter 
Cc: r-help@r-project.org
Subject: Re: [R] Question about Rfast colMins and colMaxs

Oh, you are segmenting standard R from the rest of R.

Well, that part did not come across to me in your original reply. I am not
clear on a standard versus non-standard list. I will look into this aspect
and see what I can learn going forward.


Thanks,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 5:26 PM, Bert Gunter wrote:

... but Rfast is *not* a "standard" package, as the rest of the PG
excerpt says. So contact the

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread Stephen H. Dawson, DSL via R-help

Thank you, Petr, for the kind explanation.


*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 12/1/21 11:19 AM, PIKAL Petr wrote:

Hi.

It is always worth to consult excellent R help.

max and min return the maximum or minimum of all the values present in their 
arguments, as integer if all are logical or integer, as double if all are 
numeric, and character otherwise.

Character versions are sorted lexicographically, and this depends on the collating sequence of the 
locale in use: the help for ‘Comparison’ gives details. The max/min of an empty character vector is 
defined to be character NA. (One could argue that as "" is the smallest character 
element, the maximum should be "", but there is no obvious candidate for the minimum.)

Cheers
Petr


-Original Message-
From: R-help  On Behalf Of Stephen H.
Dawson, DSL via R-help
Sent: Wednesday, December 1, 2021 5:11 PM
To: r-help@r-project.org
Subject: Re: [R] Question about Rfast colMins and colMaxs

Jeff,

Can you use max and min evaluations on any other data type then numeric?
If so, how do you evaluate max or min of text content? String length?
Ascii values of text characters?


*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 5:23 PM, Stephen H. Dawson, DSL via R-help wrote:

Well, no it is not. The email list stripped off the attachment.

The data is numeric, happens to be all whole numbers.


Kindest Regards,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 5:14 PM, Stephen H. Dawson, DSL via R-help wrote:

Hi Jeff,


Thanks for the data review offer. Attached is the CSV.


*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 3:29 PM, Jeff Newmiller wrote:

I don't know anything about this package, but read.csv returns a
data frame. How you go about forming a matrix using that data frame
depends what is in it. If it is all numeric then as.matrix may be
all you need.

Half of any R data analysis is data... and the details are almost
always crucial. Since you have told us nothing useful about the
data, it is up to you to inspect your data and figure out what to do
with it.

On November 30, 2021 10:55:13 AM PST, "Stephen H. Dawson, DSL via
R-help"  wrote:

Hi,


I am working to understand the Rfast functions of colMins and
colMaxs. I worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF
saying I need to bring data into R using a matrix. I think read.csv
brings the data in as a dataframe. I think colMins is failing
because it is looking for a matrix but finds a dataframe.


colMaxs(Data)

Error in colMaxs(Data) :
Not compatible with requested type: [type=list; target=double].

colMins(Data, na.rm = TRUE)

Error in colMins(Data, na.rm = TRUE) :
unused argument (na.rm = TRUE)

colMins(Data, value = FALSE, parallel = FALSE)

Error in colMins(Data, value = FALSE, parallel = FALSE) :
Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it
can be accessed by colMaxs and colMins, please?


Thanks,

__
R-help@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.


__
R-help@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.


__
R-help@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.


__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread Stephen H. Dawson, DSL via R-help
 extend to many similar ideas like this one that calulates the min
unless you over-ride it with max or mean or sd or a bizarre function like
`[` so a call to:

mycolCalc(df, `[`, 3)

Will return exactly the third items in each row!

I find it to be very common for someone these days to do a quick search for
a way to do something in a language like R and not really look to see if it
is a standard way or something special/ Matrices in R are not quite the same
as some other objects like a data.frame or tibble and a package written to
be used on one may (or may not) happen to work with another. Some packages
are carefully written to try to detect what kind of object it gets and when
possible convert it to another. The "apply" function is meant for matrices
but if it sees something else it looks ta the dimensionality and tries to
coerce it with as.matrix or as.array first. As others have noted, this mean
a data.frame containing non-numeric parts may fail or should have any other
columns hidden/removed as in this df that has some non-numeric fields:


df

i   s   f b i2
1 1   hello 1.2  TRUE  5
2 2   there 2.3 FALSE  4
3 3 goodbye 3.4  TRUE  3

So a bit more complex one-liner removes any non-numeric columns like this:


mycolMins(df[, sapply(df, is.numeric)])

$i
[1] 1

$f
[1] 1.2

$i2
[1] 3

Clearly converting that to a matrix while whole would result in everything
being converted to character and a minimum may be elusive.

-Original Message-
From: R-help  On Behalf Of Stephen H. Dawson,
DSL via R-help
Sent: Tuesday, November 30, 2021 5:37 PM
To: Bert Gunter 
Cc: r-help@r-project.org
Subject: Re: [R] Question about Rfast colMins and colMaxs

Oh, you are segmenting standard R from the rest of R.

Well, that part did not come across to me in your original reply. I am not
clear on a standard versus non-standard list. I will look into this aspect
and see what I can learn going forward.


Thanks,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 5:26 PM, Bert Gunter wrote:

... but Rfast is *not* a "standard" package, as the rest of the PG
excerpt says. So contact the maintainer and ask him/her what they
think the best practice should be for their package. As has been
pointed out already, it appears to differ from the usual "read it in
as a data frame" procedure.

Bert

On Tue, Nov 30, 2021 at 2:11 PM Stephen H. Dawson, DSL
 wrote:

Right, R Studio is not R.

However, the Rfast package is part of R.

https://cran.r-project.org/web/packages/Rfast/index.html

So, rephrasing my question...
What is the best practice to bring a csv file into R so it can be
accessed by colMaxs and colMins, please?

*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 3:19 PM, Bert Gunter wrote:

RStudio is **not** R. In particular, the so-called TidyVerse
consists of all *non*-standard contributed packages, about which the PG

says:

"For questions about functions in standard packages distributed with
R (see the FAQ Add-on packages in R), ask questions on R-help.
[The link is:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
This gives the list of current _standard_ packages]

If the question relates to a contributed package , e.g., one
downloaded from CRAN, try contacting the package maintainer first.
You can also use find("functionname") and
packageDescription("packagename") to find this information. Only
send such questions to R-help or R-devel if you get no reply or need
further assistance. This applies to both requests for help and to
bug reports."

Note that RStudio maintains its own help resources at:
https://community.rstudio.com/
This is where questions about the TidyVerse, ggplot, etc. should be

posted.



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 Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help
 wrote:

Hi,


I am working to understand the Rfast functions of colMins and
colMaxs. I worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF
saying I need to bring data into R using a matrix. I think read.csv
brings the data in as a dataframe. I think colMins is failing
because it is looking for a matrix but finds a dataframe.

> colMaxs(Data)
Error in colMaxs(Data) :
  Not compatible with requested type: [type=list; target=dou

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread Jeff Newmiller
calulates the min
>unless you over-ride it with max or mean or sd or a bizarre function like
>`[` so a call to:
>
>mycolCalc(df, `[`, 3)
>
>Will return exactly the third items in each row!
>
>I find it to be very common for someone these days to do a quick search for
>a way to do something in a language like R and not really look to see if it
>is a standard way or something special/ Matrices in R are not quite the same
>as some other objects like a data.frame or tibble and a package written to
>be used on one may (or may not) happen to work with another. Some packages
>are carefully written to try to detect what kind of object it gets and when
>possible convert it to another. The "apply" function is meant for matrices
>but if it sees something else it looks ta the dimensionality and tries to
>coerce it with as.matrix or as.array first. As others have noted, this mean
>a data.frame containing non-numeric parts may fail or should have any other
>columns hidden/removed as in this df that has some non-numeric fields:
>
>> df
>i   s   f b i2
>1 1   hello 1.2  TRUE  5
>2 2   there 2.3 FALSE  4
>3 3 goodbye 3.4  TRUE  3
>
>So a bit more complex one-liner removes any non-numeric columns like this:
>
>> mycolMins(df[, sapply(df, is.numeric)])
>$i
>[1] 1
>
>$f
>[1] 1.2
>
>$i2
>[1] 3
>
>Clearly converting that to a matrix while whole would result in everything
>being converted to character and a minimum may be elusive.
>
>-Original Message-
>From: R-help  On Behalf Of Stephen H. Dawson,
>DSL via R-help
>Sent: Tuesday, November 30, 2021 5:37 PM
>To: Bert Gunter 
>Cc: r-help@r-project.org
>Subject: Re: [R] Question about Rfast colMins and colMaxs
>
>Oh, you are segmenting standard R from the rest of R.
>
>Well, that part did not come across to me in your original reply. I am not
>clear on a standard versus non-standard list. I will look into this aspect
>and see what I can learn going forward.
>
>
>Thanks,
>*Stephen Dawson, DSL*
>/Executive Strategy Consultant/
>Business & Technology
>+1 (865) 804-3454
>http://www.shdawson.com <http://www.shdawson.com>
>
>
>On 11/30/21 5:26 PM, Bert Gunter wrote:
>> ... but Rfast is *not* a "standard" package, as the rest of the PG 
>> excerpt says. So contact the maintainer and ask him/her what they 
>> think the best practice should be for their package. As has been 
>> pointed out already, it appears to differ from the usual "read it in 
>> as a data frame" procedure.
>>
>> Bert
>>
>> On Tue, Nov 30, 2021 at 2:11 PM Stephen H. Dawson, DSL 
>>  wrote:
>>> Right, R Studio is not R.
>>>
>>> However, the Rfast package is part of R.
>>>
>>> https://cran.r-project.org/web/packages/Rfast/index.html
>>>
>>> So, rephrasing my question...
>>> What is the best practice to bring a csv file into R so it can be 
>>> accessed by colMaxs and colMins, please?
>>>
>>> *Stephen Dawson, DSL*
>>> /Executive Strategy Consultant/
>>> Business & Technology
>>> +1 (865) 804-3454
>>> http://www.shdawson.com <http://www.shdawson.com>
>>>
>>>
>>> On 11/30/21 3:19 PM, Bert Gunter wrote:
>>>> RStudio is **not** R. In particular, the so-called TidyVerse 
>>>> consists of all *non*-standard contributed packages, about which the PG
>says:
>>>>
>>>> "For questions about functions in standard packages distributed with 
>>>> R (see the FAQ Add-on packages in R), ask questions on R-help.
>>>> [The link is:
>>>> https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
>>>> This gives the list of current _standard_ packages]
>>>>
>>>> If the question relates to a contributed package , e.g., one 
>>>> downloaded from CRAN, try contacting the package maintainer first. 
>>>> You can also use find("functionname") and
>>>> packageDescription("packagename") to find this information. Only 
>>>> send such questions to R-help or R-devel if you get no reply or need 
>>>> further assistance. This applies to both requests for help and to 
>>>> bug reports."
>>>>
>>>> Note that RStudio maintains its own help resources at:
>>>> https://community.rstudio.com/
>>>> This is where questions about the TidyVerse, ggplot, etc. should be
>posted.
>>>>
>>>>
>>>>
>>>> Bert Gunter
>>>>
>>>> "The trouble with having an open

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread PIKAL Petr
Hi.

It is always worth to consult excellent R help.

max and min return the maximum or minimum of all the values present in their 
arguments, as integer if all are logical or integer, as double if all are 
numeric, and character otherwise.

Character versions are sorted lexicographically, and this depends on the 
collating sequence of the locale in use: the help for ‘Comparison’ gives 
details. The max/min of an empty character vector is defined to be character 
NA. (One could argue that as "" is the smallest character element, the maximum 
should be "", but there is no obvious candidate for the minimum.)

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of Stephen H.
> Dawson, DSL via R-help
> Sent: Wednesday, December 1, 2021 5:11 PM
> To: r-help@r-project.org
> Subject: Re: [R] Question about Rfast colMins and colMaxs
> 
> Jeff,
> 
> Can you use max and min evaluations on any other data type then numeric?
> If so, how do you evaluate max or min of text content? String length?
> Ascii values of text characters?
> 
> 
> *Stephen Dawson, DSL*
> /Executive Strategy Consultant/
> Business & Technology
> +1 (865) 804-3454
> http://www.shdawson.com <http://www.shdawson.com>
> 
> 
> On 11/30/21 5:23 PM, Stephen H. Dawson, DSL via R-help wrote:
> > Well, no it is not. The email list stripped off the attachment.
> >
> > The data is numeric, happens to be all whole numbers.
> >
> >
> > Kindest Regards,
> > *Stephen Dawson, DSL*
> > /Executive Strategy Consultant/
> > Business & Technology
> > +1 (865) 804-3454
> > http://www.shdawson.com <http://www.shdawson.com>
> >
> >
> > On 11/30/21 5:14 PM, Stephen H. Dawson, DSL via R-help wrote:
> >> Hi Jeff,
> >>
> >>
> >> Thanks for the data review offer. Attached is the CSV.
> >>
> >>
> >> *Stephen Dawson, DSL*
> >> /Executive Strategy Consultant/
> >> Business & Technology
> >> +1 (865) 804-3454
> >> http://www.shdawson.com <http://www.shdawson.com>
> >>
> >>
> >> On 11/30/21 3:29 PM, Jeff Newmiller wrote:
> >>> I don't know anything about this package, but read.csv returns a
> >>> data frame. How you go about forming a matrix using that data frame
> >>> depends what is in it. If it is all numeric then as.matrix may be
> >>> all you need.
> >>>
> >>> Half of any R data analysis is data... and the details are almost
> >>> always crucial. Since you have told us nothing useful about the
> >>> data, it is up to you to inspect your data and figure out what to do
> >>> with it.
> >>>
> >>> On November 30, 2021 10:55:13 AM PST, "Stephen H. Dawson, DSL via
> >>> R-help"  wrote:
> >>>> Hi,
> >>>>
> >>>>
> >>>> I am working to understand the Rfast functions of colMins and
> >>>> colMaxs. I worked through the example listed on page 54 of the PDF.
> >>>>
> >>>> https://cran.r-project.org/web/packages/Rfast/index.html
> >>>>
> >>>> https://cran.r-project.org/web/packages/Rfast/Rfast.pdf
> >>>>
> >>>> My data is in a CSV file. So, I bring it into R Studio using:
> >>>> Data <- read.csv("./input/DataSet05.csv", header=T)
> >>>>
> >>>> However, I read the instructions listed on page 54 of the PDF
> >>>> saying I need to bring data into R using a matrix. I think read.csv
> >>>> brings the data in as a dataframe. I think colMins is failing
> >>>> because it is looking for a matrix but finds a dataframe.
> >>>>
> >>>>> colMaxs(Data)
> >>>> Error in colMaxs(Data) :
> >>>>Not compatible with requested type: [type=list; target=double].
> >>>>> colMins(Data, na.rm = TRUE)
> >>>> Error in colMins(Data, na.rm = TRUE) :
> >>>>unused argument (na.rm = TRUE)
> >>>>> colMins(Data, value = FALSE, parallel = FALSE)
> >>>> Error in colMins(Data, value = FALSE, parallel = FALSE) :
> >>>>Not compatible with requested type: [type=list; target=double].
> >>>>
> >>>> QUESTION
> >>>> What is the best practice to bring a csv file into R Studio so it
> >>>> can be accessed by colMaxs and colMins, please?
> >>>>
> >>>>
> >>>> Thanks,
> >>
> >> _

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread Stephen H. Dawson, DSL via R-help

Jeff,

Can you use max and min evaluations on any other data type then numeric? 
If so, how do you evaluate max or min of text content? String length? 
Ascii values of text characters?



*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 5:23 PM, Stephen H. Dawson, DSL via R-help wrote:

Well, no it is not. The email list stripped off the attachment.

The data is numeric, happens to be all whole numbers.


Kindest Regards,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 5:14 PM, Stephen H. Dawson, DSL via R-help wrote:

Hi Jeff,


Thanks for the data review offer. Attached is the CSV.


*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 3:29 PM, Jeff Newmiller wrote:
I don't know anything about this package, but read.csv returns a 
data frame. How you go about forming a matrix using that data frame 
depends what is in it. If it is all numeric then as.matrix may be 
all you need.


Half of any R data analysis is data... and the details are almost 
always crucial. Since you have told us nothing useful about the 
data, it is up to you to inspect your data and figure out what to do 
with it.


On November 30, 2021 10:55:13 AM PST, "Stephen H. Dawson, DSL via 
R-help"  wrote:

Hi,


I am working to understand the Rfast functions of colMins and 
colMaxs. I

worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF saying I
need to bring data into R using a matrix. I think read.csv brings the
data in as a dataframe. I think colMins is failing because it is 
looking

for a matrix but finds a dataframe.


colMaxs(Data)

Error in colMaxs(Data) :
   Not compatible with requested type: [type=list; target=double].

colMins(Data, na.rm = TRUE)

Error in colMins(Data, na.rm = TRUE) :
   unused argument (na.rm = TRUE)

colMins(Data, value = FALSE, parallel = FALSE)

Error in colMins(Data, value = FALSE, parallel = FALSE) :
   Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it 
can be

accessed by colMaxs and colMins, please?


Thanks,


__
R-help@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.



__
R-help@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.



__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Avi Gross via R-help
Stephen,

Although what is in the STANDARD R distribution can vary several ways, in
general, if you need to add a line like:

library(something)
or
require(something)

and your code does not work unless you have done that, then you can imagine
it is not sort of built in to R as it starts.

Having said that, tons of exceptions may exist that cause R to load in
things on your machine for everyone or just for you without you having to
notice.

I think this forum lately has been deluged with questions about all kinds of
add-on packages and in particular, lots of the ones in the tidyverse.
Clearly the purpose here is not that broad.

But since I use some packages like the tidyverse extensively, and I am far
from alone, I wonder if someday the powers that be realize it is a losing
battle to exclude at least some of it. It would be so nice not having to
include a long list of packages for some programs or somehow arrange that
people using something you shared had installed and loaded them. But there
are too many packages out there of varying quality and usefulness and
popularity with more every day being added. Worse, many are somewhat
incompatible such as having functions with the same names that hide earlier
ones loaded.

Base R doe come with functions like colSums and colMeans and similar row
functions. But as mentioned, a data.frame is a list of vectors and R
supports certain functional programming constructs over lists using things
like:

lapply(df, min)
sapply(df, min)

And actually quite a few ways depending on what info you want back and
whether you insist it be returned as a list or vector or other things . You
can even supply additional arguments that might be needed such as if you
want to ignore any NA values,

lapply(df, min, na.rm=TRUE

The package you looked at it is trying to be fast and uses what looks like
compiled external code but so does lapply.

If this is too bothersome for you, consider making a one-liner function like
this:

mycolMins <- function(df, ...) lapply(df, min, ...)

Once defined, you can use that just fine and not think about it again and I
note this answer (like others) is offering you something in base R that
works fine on data.frames and the like.

You can extend to many similar ideas like this one that calulates the min
unless you over-ride it with max or mean or sd or a bizarre function like
`[` so a call to:

mycolCalc(df, `[`, 3)

Will return exactly the third items in each row!

I find it to be very common for someone these days to do a quick search for
a way to do something in a language like R and not really look to see if it
is a standard way or something special/ Matrices in R are not quite the same
as some other objects like a data.frame or tibble and a package written to
be used on one may (or may not) happen to work with another. Some packages
are carefully written to try to detect what kind of object it gets and when
possible convert it to another. The "apply" function is meant for matrices
but if it sees something else it looks ta the dimensionality and tries to
coerce it with as.matrix or as.array first. As others have noted, this mean
a data.frame containing non-numeric parts may fail or should have any other
columns hidden/removed as in this df that has some non-numeric fields:

> df
i   s   f b i2
1 1   hello 1.2  TRUE  5
2 2   there 2.3 FALSE  4
3 3 goodbye 3.4  TRUE  3

So a bit more complex one-liner removes any non-numeric columns like this:

> mycolMins(df[, sapply(df, is.numeric)])
$i
[1] 1

$f
[1] 1.2

$i2
[1] 3

Clearly converting that to a matrix while whole would result in everything
being converted to character and a minimum may be elusive.

-Original Message-
From: R-help  On Behalf Of Stephen H. Dawson,
DSL via R-help
Sent: Tuesday, November 30, 2021 5:37 PM
To: Bert Gunter 
Cc: r-help@r-project.org
Subject: Re: [R] Question about Rfast colMins and colMaxs

Oh, you are segmenting standard R from the rest of R.

Well, that part did not come across to me in your original reply. I am not
clear on a standard versus non-standard list. I will look into this aspect
and see what I can learn going forward.


Thanks,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com <http://www.shdawson.com>


On 11/30/21 5:26 PM, Bert Gunter wrote:
> ... but Rfast is *not* a "standard" package, as the rest of the PG 
> excerpt says. So contact the maintainer and ask him/her what they 
> think the best practice should be for their package. As has been 
> pointed out already, it appears to differ from the usual "read it in 
> as a data frame" procedure.
>
> Bert
>
> On Tue, Nov 30, 2021 at 2:11 PM Stephen H. Dawson, DSL 
>  wrote:
>> Right, R Studio is not R.
>>
>> However, the Rfast package is part of R.
>>
>> https://cran.r-project.org/web/packages/Rfast/index.html
>>

Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Bert Gunter
If you look at my original reply, it gives the link that tells you
*exactly* what packages are "standard" (and all the thousands of
others which therefore are not).

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 Tue, Nov 30, 2021 at 2:37 PM Stephen H. Dawson, DSL
 wrote:
>
> Oh, you are segmenting standard R from the rest of R.
>
> Well, that part did not come across to me in your original reply. I am
> not clear on a standard versus non-standard list. I will look into this
> aspect and see what I can learn going forward.
>
>
> Thanks,
> *Stephen Dawson, DSL*
> /Executive Strategy Consultant/
> Business & Technology
> +1 (865) 804-3454
> http://www.shdawson.com 
>
>
> On 11/30/21 5:26 PM, Bert Gunter wrote:
> > ... but Rfast is *not* a "standard" package, as the rest of the PG
> > excerpt says. So contact the maintainer and ask him/her what they
> > think the best practice should be for their package. As has been
> > pointed out already, it appears to differ from the usual "read it in
> > as a data frame" procedure.
> >
> > Bert
> >
> > On Tue, Nov 30, 2021 at 2:11 PM Stephen H. Dawson, DSL
> >  wrote:
> >> Right, R Studio is not R.
> >>
> >> However, the Rfast package is part of R.
> >>
> >> https://cran.r-project.org/web/packages/Rfast/index.html
> >>
> >> So, rephrasing my question...
> >> What is the best practice to bring a csv file into R so it can be
> >> accessed by colMaxs and colMins, please?
> >>
> >> *Stephen Dawson, DSL*
> >> /Executive Strategy Consultant/
> >> Business & Technology
> >> +1 (865) 804-3454
> >> http://www.shdawson.com 
> >>
> >>
> >> On 11/30/21 3:19 PM, Bert Gunter wrote:
> >>> RStudio is **not** R. In particular, the so-called TidyVerse consists
> >>> of all *non*-standard contributed packages, about which the PG says:
> >>>
> >>> "For questions about functions in standard packages distributed with R
> >>> (see the FAQ Add-on packages in R), ask questions on R-help.
> >>> [The link is:
> >>> https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
> >>> This gives the list of current _standard_ packages]
> >>>
> >>> If the question relates to a contributed package , e.g., one
> >>> downloaded from CRAN, try contacting the package maintainer first. You
> >>> can also use find("functionname") and
> >>> packageDescription("packagename") to find this information. Only send
> >>> such questions to R-help or R-devel if you get no reply or need
> >>> further assistance. This applies to both requests for help and to bug
> >>> reports."
> >>>
> >>> Note that RStudio maintains its own help resources at:
> >>> https://community.rstudio.com/
> >>> This is where questions about the TidyVerse, ggplot, etc. should be 
> >>> posted.
> >>>
> >>>
> >>>
> >>> 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 Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help
> >>>  wrote:
>  Hi,
> 
> 
>  I am working to understand the Rfast functions of colMins and colMaxs. I
>  worked through the example listed on page 54 of the PDF.
> 
>  https://cran.r-project.org/web/packages/Rfast/index.html
> 
>  https://cran.r-project.org/web/packages/Rfast/Rfast.pdf
> 
>  My data is in a CSV file. So, I bring it into R Studio using:
>  Data <- read.csv("./input/DataSet05.csv", header=T)
> 
>  However, I read the instructions listed on page 54 of the PDF saying I
>  need to bring data into R using a matrix. I think read.csv brings the
>  data in as a dataframe. I think colMins is failing because it is looking
>  for a matrix but finds a dataframe.
> 
> > colMaxs(Data)
>  Error in colMaxs(Data) :
>   Not compatible with requested type: [type=list; target=double].
> > colMins(Data, na.rm = TRUE)
>  Error in colMins(Data, na.rm = TRUE) :
>   unused argument (na.rm = TRUE)
> > colMins(Data, value = FALSE, parallel = FALSE)
>  Error in colMins(Data, value = FALSE, parallel = FALSE) :
>   Not compatible with requested type: [type=list; target=double].
> 
>  QUESTION
>  What is the best practice to bring a csv file into R Studio so it can be
>  accessed by colMaxs and colMins, please?
> 
> 
>  Thanks,
>  --
>  *Stephen Dawson, DSL*
>  /Executive Strategy Consultant/
>  Business & Technology
>  +1 (865) 804-3454
>  http://www.shdawson.com 
> 
>  __
>  R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>  https://stat.ethz.ch/mailman/listinfo/r-help
>  PLEASE do read the 

Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Stephen H. Dawson, DSL via R-help

Oh, you are segmenting standard R from the rest of R.

Well, that part did not come across to me in your original reply. I am 
not clear on a standard versus non-standard list. I will look into this 
aspect and see what I can learn going forward.



Thanks,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 5:26 PM, Bert Gunter wrote:

... but Rfast is *not* a "standard" package, as the rest of the PG
excerpt says. So contact the maintainer and ask him/her what they
think the best practice should be for their package. As has been
pointed out already, it appears to differ from the usual "read it in
as a data frame" procedure.

Bert

On Tue, Nov 30, 2021 at 2:11 PM Stephen H. Dawson, DSL
 wrote:

Right, R Studio is not R.

However, the Rfast package is part of R.

https://cran.r-project.org/web/packages/Rfast/index.html

So, rephrasing my question...
What is the best practice to bring a csv file into R so it can be
accessed by colMaxs and colMins, please?

*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 3:19 PM, Bert Gunter wrote:

RStudio is **not** R. In particular, the so-called TidyVerse consists
of all *non*-standard contributed packages, about which the PG says:

"For questions about functions in standard packages distributed with R
(see the FAQ Add-on packages in R), ask questions on R-help.
[The link is:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
This gives the list of current _standard_ packages]

If the question relates to a contributed package , e.g., one
downloaded from CRAN, try contacting the package maintainer first. You
can also use find("functionname") and
packageDescription("packagename") to find this information. Only send
such questions to R-help or R-devel if you get no reply or need
further assistance. This applies to both requests for help and to bug
reports."

Note that RStudio maintains its own help resources at:
https://community.rstudio.com/
This is where questions about the TidyVerse, ggplot, etc. should be posted.



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 Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help
 wrote:

Hi,


I am working to understand the Rfast functions of colMins and colMaxs. I
worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF saying I
need to bring data into R using a matrix. I think read.csv brings the
data in as a dataframe. I think colMins is failing because it is looking
for a matrix but finds a dataframe.

   > colMaxs(Data)
Error in colMaxs(Data) :
 Not compatible with requested type: [type=list; target=double].
   > colMins(Data, na.rm = TRUE)
Error in colMins(Data, na.rm = TRUE) :
 unused argument (na.rm = TRUE)
   > colMins(Data, value = FALSE, parallel = FALSE)
Error in colMins(Data, value = FALSE, parallel = FALSE) :
 Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it can be
accessed by colMaxs and colMins, please?


Thanks,
--
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 

__
R-help@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.




__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Bert Gunter
... but Rfast is *not* a "standard" package, as the rest of the PG
excerpt says. So contact the maintainer and ask him/her what they
think the best practice should be for their package. As has been
pointed out already, it appears to differ from the usual "read it in
as a data frame" procedure.

Bert

On Tue, Nov 30, 2021 at 2:11 PM Stephen H. Dawson, DSL
 wrote:
>
> Right, R Studio is not R.
>
> However, the Rfast package is part of R.
>
> https://cran.r-project.org/web/packages/Rfast/index.html
>
> So, rephrasing my question...
> What is the best practice to bring a csv file into R so it can be
> accessed by colMaxs and colMins, please?
>
> *Stephen Dawson, DSL*
> /Executive Strategy Consultant/
> Business & Technology
> +1 (865) 804-3454
> http://www.shdawson.com 
>
>
> On 11/30/21 3:19 PM, Bert Gunter wrote:
> > RStudio is **not** R. In particular, the so-called TidyVerse consists
> > of all *non*-standard contributed packages, about which the PG says:
> >
> > "For questions about functions in standard packages distributed with R
> > (see the FAQ Add-on packages in R), ask questions on R-help.
> > [The link is:
> > https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
> > This gives the list of current _standard_ packages]
> >
> > If the question relates to a contributed package , e.g., one
> > downloaded from CRAN, try contacting the package maintainer first. You
> > can also use find("functionname") and
> > packageDescription("packagename") to find this information. Only send
> > such questions to R-help or R-devel if you get no reply or need
> > further assistance. This applies to both requests for help and to bug
> > reports."
> >
> > Note that RStudio maintains its own help resources at:
> > https://community.rstudio.com/
> > This is where questions about the TidyVerse, ggplot, etc. should be posted.
> >
> >
> >
> > 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 Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help
> >  wrote:
> >> Hi,
> >>
> >>
> >> I am working to understand the Rfast functions of colMins and colMaxs. I
> >> worked through the example listed on page 54 of the PDF.
> >>
> >> https://cran.r-project.org/web/packages/Rfast/index.html
> >>
> >> https://cran.r-project.org/web/packages/Rfast/Rfast.pdf
> >>
> >> My data is in a CSV file. So, I bring it into R Studio using:
> >> Data <- read.csv("./input/DataSet05.csv", header=T)
> >>
> >> However, I read the instructions listed on page 54 of the PDF saying I
> >> need to bring data into R using a matrix. I think read.csv brings the
> >> data in as a dataframe. I think colMins is failing because it is looking
> >> for a matrix but finds a dataframe.
> >>
> >>   > colMaxs(Data)
> >> Error in colMaxs(Data) :
> >> Not compatible with requested type: [type=list; target=double].
> >>   > colMins(Data, na.rm = TRUE)
> >> Error in colMins(Data, na.rm = TRUE) :
> >> unused argument (na.rm = TRUE)
> >>   > colMins(Data, value = FALSE, parallel = FALSE)
> >> Error in colMins(Data, value = FALSE, parallel = FALSE) :
> >> Not compatible with requested type: [type=list; target=double].
> >>
> >> QUESTION
> >> What is the best practice to bring a csv file into R Studio so it can be
> >> accessed by colMaxs and colMins, please?
> >>
> >>
> >> Thanks,
> >> --
> >> *Stephen Dawson, DSL*
> >> /Executive Strategy Consultant/
> >> Business & Technology
> >> +1 (865) 804-3454
> >> http://www.shdawson.com 
> >>
> >> __
> >> R-help@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.
>
>

__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Stephen H. Dawson, DSL via R-help

Well, no it is not. The email list stripped off the attachment.

The data is numeric, happens to be all whole numbers.


Kindest Regards,
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 5:14 PM, Stephen H. Dawson, DSL via R-help wrote:

Hi Jeff,


Thanks for the data review offer. Attached is the CSV.


*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 3:29 PM, Jeff Newmiller wrote:
I don't know anything about this package, but read.csv returns a data 
frame. How you go about forming a matrix using that data frame 
depends what is in it. If it is all numeric then as.matrix may be all 
you need.


Half of any R data analysis is data... and the details are almost 
always crucial. Since you have told us nothing useful about the data, 
it is up to you to inspect your data and figure out what to do with it.


On November 30, 2021 10:55:13 AM PST, "Stephen H. Dawson, DSL via 
R-help"  wrote:

Hi,


I am working to understand the Rfast functions of colMins and 
colMaxs. I

worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF saying I
need to bring data into R using a matrix. I think read.csv brings the
data in as a dataframe. I think colMins is failing because it is 
looking

for a matrix but finds a dataframe.


colMaxs(Data)

Error in colMaxs(Data) :
   Not compatible with requested type: [type=list; target=double].

colMins(Data, na.rm = TRUE)

Error in colMins(Data, na.rm = TRUE) :
   unused argument (na.rm = TRUE)

colMins(Data, value = FALSE, parallel = FALSE)

Error in colMins(Data, value = FALSE, parallel = FALSE) :
   Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it 
can be

accessed by colMaxs and colMins, please?


Thanks,


__
R-help@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.



__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Stephen H. Dawson, DSL via R-help

Thanks, Bill.

How do you go about getting maximum and minimum values from your 
columns? Do you simply do them one column at a time? The functions I am 
identifying from Rfast do this work in bulk.



*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 3:24 PM, Bill Dunlap wrote:
You can use as.matrix() to convert your data.frame to a matrix, but 
that loses the speed/space advantages of colMins (as well as causing 
issues if some columns are not numeric).  You could write to the 
maintainer of the package to ask that data.frames be directly 
supported.  In the meantime you could use

   vapply(yourDataFrame, which.min, FUN.VALUE=NA_real_)
or
    vapply(yourDataFrame, min, FUN.VALUE=NA_real_)
instead of colMins.

-Bill

On Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help 
mailto:r-help@r-project.org>> wrote:


Hi,


I am working to understand the Rfast functions of colMins and
colMaxs. I
worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html


https://cran.r-project.org/web/packages/Rfast/Rfast.pdf


My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF
saying I
need to bring data into R using a matrix. I think read.csv brings the
data in as a dataframe. I think colMins is failing because it is
looking
for a matrix but finds a dataframe.

 > colMaxs(Data)
Error in colMaxs(Data) :
   Not compatible with requested type: [type=list; target=double].
 > colMins(Data, na.rm = TRUE)
Error in colMins(Data, na.rm = TRUE) :
   unused argument (na.rm = TRUE)
 > colMins(Data, value = FALSE, parallel = FALSE)
Error in colMins(Data, value = FALSE, parallel = FALSE) :
   Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it
can be
accessed by colMaxs and colMins, please?


Thanks,
-- 
*Stephen Dawson, DSL*

/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 
>

__
R-help@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.



__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Stephen H. Dawson, DSL via R-help

Hi Jeff,


Thanks for the data review offer. Attached is the CSV.


*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 3:29 PM, Jeff Newmiller wrote:

I don't know anything about this package, but read.csv returns a data frame. 
How you go about forming a matrix using that data frame depends what is in it. 
If it is all numeric then as.matrix may be all you need.

Half of any R data analysis is data... and the details are almost always 
crucial. Since you have told us nothing useful about the data, it is up to you 
to inspect your data and figure out what to do with it.

On November 30, 2021 10:55:13 AM PST, "Stephen H. Dawson, DSL via R-help" 
 wrote:

Hi,


I am working to understand the Rfast functions of colMins and colMaxs. I
worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF saying I
need to bring data into R using a matrix. I think read.csv brings the
data in as a dataframe. I think colMins is failing because it is looking
for a matrix but finds a dataframe.


colMaxs(Data)

Error in colMaxs(Data) :
   Not compatible with requested type: [type=list; target=double].

colMins(Data, na.rm = TRUE)

Error in colMins(Data, na.rm = TRUE) :
   unused argument (na.rm = TRUE)

colMins(Data, value = FALSE, parallel = FALSE)

Error in colMins(Data, value = FALSE, parallel = FALSE) :
   Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it can be
accessed by colMaxs and colMins, please?


Thanks,


__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Stephen H. Dawson, DSL via R-help

Right, R Studio is not R.

However, the Rfast package is part of R.

https://cran.r-project.org/web/packages/Rfast/index.html

So, rephrasing my question...
What is the best practice to bring a csv file into R so it can be 
accessed by colMaxs and colMins, please?


*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 


On 11/30/21 3:19 PM, Bert Gunter wrote:

RStudio is **not** R. In particular, the so-called TidyVerse consists
of all *non*-standard contributed packages, about which the PG says:

"For questions about functions in standard packages distributed with R
(see the FAQ Add-on packages in R), ask questions on R-help.
[The link is:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
This gives the list of current _standard_ packages]

If the question relates to a contributed package , e.g., one
downloaded from CRAN, try contacting the package maintainer first. You
can also use find("functionname") and
packageDescription("packagename") to find this information. Only send
such questions to R-help or R-devel if you get no reply or need
further assistance. This applies to both requests for help and to bug
reports."

Note that RStudio maintains its own help resources at:
https://community.rstudio.com/
This is where questions about the TidyVerse, ggplot, etc. should be posted.



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 Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help
 wrote:

Hi,


I am working to understand the Rfast functions of colMins and colMaxs. I
worked through the example listed on page 54 of the PDF.

https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF saying I
need to bring data into R using a matrix. I think read.csv brings the
data in as a dataframe. I think colMins is failing because it is looking
for a matrix but finds a dataframe.

  > colMaxs(Data)
Error in colMaxs(Data) :
Not compatible with requested type: [type=list; target=double].
  > colMins(Data, na.rm = TRUE)
Error in colMins(Data, na.rm = TRUE) :
unused argument (na.rm = TRUE)
  > colMins(Data, value = FALSE, parallel = FALSE)
Error in colMins(Data, value = FALSE, parallel = FALSE) :
Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it can be
accessed by colMaxs and colMins, please?


Thanks,
--
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 

__
R-help@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.


__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Jeff Newmiller
I don't know anything about this package, but read.csv returns a data frame. 
How you go about forming a matrix using that data frame depends what is in it. 
If it is all numeric then as.matrix may be all you need.

Half of any R data analysis is data... and the details are almost always 
crucial. Since you have told us nothing useful about the data, it is up to you 
to inspect your data and figure out what to do with it.

On November 30, 2021 10:55:13 AM PST, "Stephen H. Dawson, DSL via R-help" 
 wrote:
>Hi,
>
>
>I am working to understand the Rfast functions of colMins and colMaxs. I 
>worked through the example listed on page 54 of the PDF.
>
>https://cran.r-project.org/web/packages/Rfast/index.html
>
>https://cran.r-project.org/web/packages/Rfast/Rfast.pdf
>
>My data is in a CSV file. So, I bring it into R Studio using:
>Data <- read.csv("./input/DataSet05.csv", header=T)
>
>However, I read the instructions listed on page 54 of the PDF saying I 
>need to bring data into R using a matrix. I think read.csv brings the 
>data in as a dataframe. I think colMins is failing because it is looking 
>for a matrix but finds a dataframe.
>
> > colMaxs(Data)
>Error in colMaxs(Data) :
>   Not compatible with requested type: [type=list; target=double].
> > colMins(Data, na.rm = TRUE)
>Error in colMins(Data, na.rm = TRUE) :
>   unused argument (na.rm = TRUE)
> > colMins(Data, value = FALSE, parallel = FALSE)
>Error in colMins(Data, value = FALSE, parallel = FALSE) :
>   Not compatible with requested type: [type=list; target=double].
>
>QUESTION
>What is the best practice to bring a csv file into R Studio so it can be 
>accessed by colMaxs and colMins, please?
>
>
>Thanks,

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Bill Dunlap
You can use as.matrix() to convert your data.frame to a matrix, but that
loses the speed/space advantages of colMins (as well as causing issues if
some columns are not numeric).  You could write to the maintainer of the
package to ask that data.frames be directly supported.  In the meantime you
could use
   vapply(yourDataFrame, which.min, FUN.VALUE=NA_real_)
or
vapply(yourDataFrame, min, FUN.VALUE=NA_real_)
instead of colMins.

-Bill

On Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help <
r-help@r-project.org> wrote:

> Hi,
>
>
> I am working to understand the Rfast functions of colMins and colMaxs. I
> worked through the example listed on page 54 of the PDF.
>
> https://cran.r-project.org/web/packages/Rfast/index.html
>
> https://cran.r-project.org/web/packages/Rfast/Rfast.pdf
>
> My data is in a CSV file. So, I bring it into R Studio using:
> Data <- read.csv("./input/DataSet05.csv", header=T)
>
> However, I read the instructions listed on page 54 of the PDF saying I
> need to bring data into R using a matrix. I think read.csv brings the
> data in as a dataframe. I think colMins is failing because it is looking
> for a matrix but finds a dataframe.
>
>  > colMaxs(Data)
> Error in colMaxs(Data) :
>Not compatible with requested type: [type=list; target=double].
>  > colMins(Data, na.rm = TRUE)
> Error in colMins(Data, na.rm = TRUE) :
>unused argument (na.rm = TRUE)
>  > colMins(Data, value = FALSE, parallel = FALSE)
> Error in colMins(Data, value = FALSE, parallel = FALSE) :
>Not compatible with requested type: [type=list; target=double].
>
> QUESTION
> What is the best practice to bring a csv file into R Studio so it can be
> accessed by colMaxs and colMins, please?
>
>
> Thanks,
> --
> *Stephen Dawson, DSL*
> /Executive Strategy Consultant/
> Business & Technology
> +1 (865) 804-3454
> http://www.shdawson.com 
>
> __
> R-help@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]]

__
R-help@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.


Re: [R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Bert Gunter
RStudio is **not** R. In particular, the so-called TidyVerse consists
of all *non*-standard contributed packages, about which the PG says:

"For questions about functions in standard packages distributed with R
(see the FAQ Add-on packages in R), ask questions on R-help.
[The link is:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
This gives the list of current _standard_ packages]

If the question relates to a contributed package , e.g., one
downloaded from CRAN, try contacting the package maintainer first. You
can also use find("functionname") and
packageDescription("packagename") to find this information. Only send
such questions to R-help or R-devel if you get no reply or need
further assistance. This applies to both requests for help and to bug
reports."

Note that RStudio maintains its own help resources at:
https://community.rstudio.com/
This is where questions about the TidyVerse, ggplot, etc. should be posted.



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 Tue, Nov 30, 2021 at 10:55 AM Stephen H. Dawson, DSL via R-help
 wrote:
>
> Hi,
>
>
> I am working to understand the Rfast functions of colMins and colMaxs. I
> worked through the example listed on page 54 of the PDF.
>
> https://cran.r-project.org/web/packages/Rfast/index.html
>
> https://cran.r-project.org/web/packages/Rfast/Rfast.pdf
>
> My data is in a CSV file. So, I bring it into R Studio using:
> Data <- read.csv("./input/DataSet05.csv", header=T)
>
> However, I read the instructions listed on page 54 of the PDF saying I
> need to bring data into R using a matrix. I think read.csv brings the
> data in as a dataframe. I think colMins is failing because it is looking
> for a matrix but finds a dataframe.
>
>  > colMaxs(Data)
> Error in colMaxs(Data) :
>Not compatible with requested type: [type=list; target=double].
>  > colMins(Data, na.rm = TRUE)
> Error in colMins(Data, na.rm = TRUE) :
>unused argument (na.rm = TRUE)
>  > colMins(Data, value = FALSE, parallel = FALSE)
> Error in colMins(Data, value = FALSE, parallel = FALSE) :
>Not compatible with requested type: [type=list; target=double].
>
> QUESTION
> What is the best practice to bring a csv file into R Studio so it can be
> accessed by colMaxs and colMins, please?
>
>
> Thanks,
> --
> *Stephen Dawson, DSL*
> /Executive Strategy Consultant/
> Business & Technology
> +1 (865) 804-3454
> http://www.shdawson.com 
>
> __
> R-help@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.

__
R-help@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.


[R] Question about Rfast colMins and colMaxs

2021-11-30 Thread Stephen H. Dawson, DSL via R-help

Hi,


I am working to understand the Rfast functions of colMins and colMaxs. I 
worked through the example listed on page 54 of the PDF.


https://cran.r-project.org/web/packages/Rfast/index.html

https://cran.r-project.org/web/packages/Rfast/Rfast.pdf

My data is in a CSV file. So, I bring it into R Studio using:
Data <- read.csv("./input/DataSet05.csv", header=T)

However, I read the instructions listed on page 54 of the PDF saying I 
need to bring data into R using a matrix. I think read.csv brings the 
data in as a dataframe. I think colMins is failing because it is looking 
for a matrix but finds a dataframe.


> colMaxs(Data)
Error in colMaxs(Data) :
  Not compatible with requested type: [type=list; target=double].
> colMins(Data, na.rm = TRUE)
Error in colMins(Data, na.rm = TRUE) :
  unused argument (na.rm = TRUE)
> colMins(Data, value = FALSE, parallel = FALSE)
Error in colMins(Data, value = FALSE, parallel = FALSE) :
  Not compatible with requested type: [type=list; target=double].

QUESTION
What is the best practice to bring a csv file into R Studio so it can be 
accessed by colMaxs and colMins, please?



Thanks,
--
*Stephen Dawson, DSL*
/Executive Strategy Consultant/
Business & Technology
+1 (865) 804-3454
http://www.shdawson.com 

__
R-help@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.