[R] Question about Rfast colMins and colMaxs

Stephen H. Dawson, DSL @erv|ce @end|ng |rom @hd@w@on@com
Wed Dec 1 18:05:13 CET 2021


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 <r-help-bounces using r-project.org> On Behalf Of Stephen H.
>> Dawson, DSL via R-help
>> Sent: Wednesday, December 1, 2021 5:11 PM
>> To: r-help using 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" <r-help using 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,
>>>> ______________________________________________
>>>> R-help using 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 using 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 using 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.



More information about the R-help mailing list