Re: [R] Date

2021-11-04 Thread Jeff Newmiller
Then you are looking at a different file... check your filenames. You have imported the column as character, and R has not yet recognized that it is supposed to be a date, so it can only show what it found. You will almost certainly find your error if you make a reproducible example. On

Re: [R] Date

2021-11-04 Thread Val
Jeff, The date from y data file looks like as follow in the Linux environment, My_date 2019-09-16 2021-02-21 2021-02-22 2017-10-11 2017-10-10 2018-11-11 2017-10-27 2017-10-30 2019-05-20 On Thu, Nov 4, 2021 at 5:00 PM Jeff Newmiller wrote: > > You are claiming behavior that is not something R

Re: [R] Date

2021-11-04 Thread Spencer Graves
My speculation is that Microsoft Excel recognized that as a date and saved it in the "mm/dd/" format you saw when reading it into R with dat=read.csv("myfile.csv"). "str" told you the format. You can convert that from character to Date using as.Date(dat$mydate, '%m/%d/%Y'), as

Re: [R] Date

2021-11-04 Thread PIKAL Petr
Hi Not sure why the date format was changed but if I am correct R do not read dates as dates but as character vector. You need to transfer such columns to dates by asDate. The error is probably from your use two asDate commands. Cheers Petr -Original Message- From: R-help On Behalf Of

Re: [R] Date

2021-11-04 Thread Jim Lemon
Hi Val, Try this: dat=read.csv("myfile.csv",stringsAsFactors=FALSE) However, the apparently silent conversion of format is a mystery to me. The only time I have struck something like this was when exporting dates from Excel some years ago, and there was a silent conversion to mm/dd/ format

Re: [R] Date

2021-11-04 Thread Jeff Newmiller
You are claiming behavior that is not something R does, but is something Excel does constantly. Compare what your data file looks like using a text editor with what R has imported. Absolutely do not use a spreadsheet program to do this. On November 4, 2021 2:43:25 PM PDT, Val wrote: >IHi All,

[R] Date

2021-11-04 Thread Val
IHi All, l, I am reading a csv file and one of the columns is named as "mydate" with this form, 2019-09-16. I am reading this file as dat=read.csv("myfile.csv") the structure of the data looks like as follow str(dat) mydate : chr "09/16/2019" "02/21/2021" "02/22/2021" "10/11/2017"

[R] Thanks for all the patient help

2021-11-04 Thread Rich Shepard
I want to thank all of you for your help the past few days. I now have all data sets imported, datetime columns added, and distribution stats calculated for each. No errors. My searches on the web for what to do when problems() produces no results, and the few comments on my stackexchange post,

Re: [R] names.data.frame?

2021-11-04 Thread Duncan Murdoch
On 04/11/2021 12:36 p.m., Bert Gunter wrote: " Running `methods(names)` lists quite a few methods, ..." Depending on what packages you have loaded of course. Yes, just one is in a base package. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] mean() produces NA on double column [FIXED]

2021-11-04 Thread Rich Shepard
On Thu, 4 Nov 2021, Rui Barradas wrote: Maybe which(is.na(pdx_stage$ft)) Have you tried na.rm = TRUE? mean(pdx_stage$ft, na.rm = TRUE) Rui, I just scrolled through the data file. Yes, there are severeal NAs when the equipment was down and I hadn't put na.rm = TRUE in the read_csv() import

Re: [R] mean() produces NA on double column

2021-11-04 Thread Rui Barradas
Hello, Maybe which(is.na(pdx_stage$ft)) Have you tried na.rm = TRUE? mean(pdx_stage$ft, na.rm = TRUE) Hope this helps, Rui Barradas Às 18:34 de 04/11/21, Rich Shepard escreveu: I'm not seeing what's different about this tibble so that mean() returns NA on a column of doubles:

[R] mean() produces NA on double column

2021-11-04 Thread Rich Shepard
I'm not seeing what's different about this tibble so that mean() returns NA on a column of doubles: head(pdx_stage) # A tibble: 6 × 8 site_nbr year mon dayhr min tz ft 1 14211720 200710 1 1 0 PDT3.21 2 14211720 200710 1 130

Re: [R-es] Ordenar data frame por variables

2021-11-04 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? Si vas a querer usar dplyr, que es lo que parece, puedes encontrar algunos ejemplos muy parecidos al tuyo aquí . En concreto, aunque has agrupado correctamente, te ha faltado decir qué es lo que quieres hacer con esos grupos (la

[R-es] Ordenar data frame por variables

2021-11-04 Thread Maximiliano Asencio
Hola, cómo están. Resulta que tengo una base de datos con los promedios de notas de distintos alumnos en distintos colegios, para distintos cursos, y necesito agrupar los alumnos por colegio y curso, para luego calcular sus notas según percentil (siendo el promedio más alto el percentil 1), pero

Re: [R] names.data.frame?

2021-11-04 Thread Bert Gunter
" Running `methods(names)` lists quite a few methods, ..." Depending on what packages you have loaded of course. Bert On Thu, Nov 4, 2021 at 7:43 AM Duncan Murdoch wrote: > On 04/11/2021 10:38 a.m., Jorgen Harmse via R-help wrote: > > Can someone please explain what Leonard Mada is trying to

Re: [R] What to do when problems() returns nothing [RESOLVED]

2021-11-04 Thread Rich Shepard
On Thu, 4 Nov 2021, Micha Silver wrote: Why are you importing the last "ft" column as an integer when it's clearly decimal data? Micha, Probably because I was still thinking of the discharge data which are integers. That explains all the issues. Mea culpa! Many thanks for seeing what I

Re: [R] What to do when problems() returns nothing

2021-11-04 Thread Micha Silver
On 04/11/2021 16:02, Rich Shepard wrote: On Thu, 4 Nov 2021, Ben Tupper wrote:   ) The gzipped data file can be downloaded from . This seems to work fine for me: library(readr) cor_stage_file <- "cor-stage.csv" cor_stage <-

Re: [R] names.data.frame?

2021-11-04 Thread Duncan Murdoch
On 04/11/2021 10:38 a.m., Jorgen Harmse via R-help wrote: Can someone please explain what Leonard Mada is trying to do? As far as I know, names is not generic and there is no names.data.frame because it’s not needed. (A data.frame seems to be just a named list with some extra functionality

Re: [R] names.data.frame?

2021-11-04 Thread Jorgen Harmse via R-help
Can someone please explain what Leonard Mada is trying to do? As far as I know, names is not generic and there is no names.data.frame because it’s not needed. (A data.frame seems to be just a named list with some extra functionality that depends on every element being a vector with the same

Re: [R] Live Online Training for High School Teachers and Students

2021-11-04 Thread Thierry Onkelinx via R-help
Dear Tracy, Maybe a workshop of Data Carpentry (https://datacarpentry.org/) might be relevant. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team

Re: [R] What to do when problems() returns nothing

2021-11-04 Thread Rich Shepard
On Thu, 4 Nov 2021, Ben Tupper wrote: The help for problems() shows that the expected argument has a default value of .Last.value. If you don't provide the input argument, it just uses the last thing your R session evaluated. That's great if you run problems() right after your issues arises.

Re: [R] What to do when problems() returns nothing

2021-11-04 Thread Ben Tupper
Hi, The help for problems() shows that the expected argument has a default value of .Last.value. If you don't provide the input argument, it just uses the last thing your R session evaluated. That's great if you run problems() right after your issues arises. But you have inserted

Re: [R] [External Email] Live Online Training for High School Teachers and Students

2021-11-04 Thread Christopher W Ryan via R-help
Tracy-- I enjoy doing this sort of thing. Over the years I've done two full-day "introduction to R" workshops for high school students. The workshops also inevitably get into software-agnostic, basic issues about how to think about data, and how to measure, record, and store it---which is all

Re: [R] names.data.frame?

2021-11-04 Thread Duncan Murdoch
On 03/11/2021 3:42 p.m., Duncan Murdoch wrote: On 03/11/2021 2:54 p.m., Andrew Simmons wrote: ... deletions ... As a side note, I would suggest making your class through the methods package, with methods::setClass("pm", ...) See the documentation for setClass for more details, it's the

[R] severe bug in LICORS/kmeanspp

2021-11-04 Thread fritzke
Hello, I found a severe bug in the function kmeanspp (k-means++ implementation) in the LICORS package (https://www.rdocumentation.org/packages/LICORS/versions/0.2.0/topics/kmeanspp) and need some advice on how to handle this (therefore posting here).   Since LICORS has not been updated since

[R] Live Online Training for High School Teachers and Students

2021-11-04 Thread Tracy Lenz
Hi, I am looking for live training that can be conducted via Zoom or another online platform to assist high school teachers and students who are working with R. These teachers and students are using R at a very basic level. They've reviewed a variety of beginner-level texts and videos on R,