Re: [R] devtools - bad credentials R4.4.1

2024-06-21 Thread Hadley Wickham
The place to start for such problems is always usethis::git_sitrep() Hadley On Thu, Jun 20, 2024 at 11:17 PM Robert Baer wrote: > I am trying to install a package from github which has worked fine in > the past, but now seems to be stuck on some new authentication issues. > Does anyone know how

Re: [R] Bug with writeClipboard in {utils}

2024-06-21 Thread Barthelemy Tanguy via R-help
Hello, Thank you for your research and your bug report. At the end of your bug report (https://bugs.r-project.org/show_bug.cgi?id=18747) you mentioned that "the problem doesn't reappear with the attached patch". Is there a way to test this patch or will there soon be a published patched R

Re: [R] Bug with writeClipboard in {utils}

2024-06-21 Thread Barthelemy Tanguy via R-help
Hello, Thank you for your different tests. You have that you didn't find any errors with Rscript or with R but I have the impression that your test with R (second test) showed additional and unwanted characters (second line of the output)? Thank you again Tanguy BARTHELEMY

Re: [R] devtools - bad credentials R4.4.1

2024-06-20 Thread Jeff Newmiller via R-help
I would delete the PAT from the credential manager since it seems to be timed out anyway... I don't know my way around the Windows Credential Manager very well, but it seems to me

Re: [R] devtools - bad credentials R4.4.1

2024-06-20 Thread Robert Baer
Not being a developer, I have limited uderstanding of PATs and global git options, but here is what I was able to cobble together to start looking at my situation: > Sys.getenv("GITHUB_PAT") [1] "" > Sys.unsetenv("GITHUB_PAT") > Sys.getenv("GITHUB_PAT") [1] "" >

Re: [R] devtools - bad credentials R4.4.1

2024-06-20 Thread Jeff Newmiller via R-help
My guess is that this is related to you saving an expired Personal Access Token in your global git options or credentials store? Git is perfectly capable of using per-repo credentials... don't configure a credential in your global configuration and it won't fall back on using it to access

[R] devtools - bad credentials R4.4.1

2024-06-20 Thread Robert Baer
I am trying to install a package from github which has worked fine in the past, but now seems to be stuck on some new authentication issues.  Does anyone know how I can straighten myself out?  In theory, this is a public repository so I'm not sure why I even need authenticating for

Re: [R] Integration of functions with a vector argument

2024-06-20 Thread Bert Gunter
The calculus package might also be relevant (not sure if it was in the Task View): https://cran.r-project.org/web/packages/calculus/index.html -- Bert On Thu, Jun 20, 2024 at 10:01 AM Bert Gunter wrote: > If you haven't already done so, you may wish to have a look here: > > >

Re: [R] Integration of functions with a vector argument

2024-06-20 Thread Bert Gunter
If you haven't already done so, you may wish to have a look here: https://cran.r-project.org/web/views/NumericalMathematics.html#differentiation-and-integration (Or perhaps in other related subtopics in the Numerical Math task view) Cheers, Bert On Thu, Jun 20, 2024 at 8:37 AM Ivan Krylov via

Re: [R] unable to get barchart of censored subjects from ggsurvplot() in survminer package, if there is no predcitor

2024-06-20 Thread Ivan Krylov via R-help
В Mon, 17 Jun 2024 15:53:16 -0400 "Christopher W. Ryan via R-help" пишет: > Caused by error: > ! Unknown colour name: strata" > about "uknown colour name strata" > ## but there are no strata rlang::last_trace() demonstrates that the error happens because some code receives a string 'strata' and

Re: [R] What is the HEX code for "transparent" color?

2024-06-20 Thread Ivan Krylov via R-help
В Mon, 17 Jun 2024 19:38:21 +0200 Yosu Yurramendi пишет: > output$distPlot <- renderPlot({ > numrows <- 3; numcols <- 3 > a <- c(1,0,1,1,1,1,1,0,1) > pattern <- matrix(a, numrows, numcols, byrow=TRUE) > palette <- c("#", "black") > par(bg="#") >

Re: [R] Bug with writeClipboard in {utils}

2024-06-20 Thread Ivan Krylov via R-help
В Thu, 20 Jun 2024 13:21:38 + Barthelemy Tanguy пишет: > Is there a way to test this patch or will there soon be a published > patched R version available for download? Not directly. If you're willing to follow the partially manual process yourself, the instructions at [1] describe how to

Re: [R] Integration of functions with a vector argument

2024-06-20 Thread Ivan Krylov via R-help
В Tue, 18 Jun 2024 23:12:03 + "Levine, Michael" пишет: > I have heard of several packages used for numerical integration in R - > cubature that you mentioned, mvQuad, and pracma. My impression is > that you think that Cubature is the best in your opinion. Is that so? Yes, but the

Re: [R] Bug with writeClipboard in {utils}

2024-06-20 Thread Rui Barradas
Hello, Inline. Às 14:15 de 20/06/2024, Barthelemy Tanguy escreveu: Hello, Thank you for your different tests. You have that you didn't find any errors with Rscript or with R but I have the impression that your test with R (second test) showed additional and unwanted characters (second line

Re: [R] plot(aov, which=1) with different labels?

2024-06-20 Thread Duncan Murdoch
On 2024-06-20 2:01 a.m., DynV Montrealer wrote: I need to do a non-English report including the red line from plot(aov, which=1), which I don't know how to reproduce. I'm thinking that if I replace the labels that it would be good (so no English remains). What I have so far is almost what I

[R] plot(aov, which=1) with different labels?

2024-06-20 Thread DynV Montrealer
I need to do a non-English report including the red line from plot(aov, which=1), which I don't know how to reproduce. I'm thinking that if I replace the labels that it would be good (so no English remains). What I have so far is almost what I need, the only thing that needs to change is what's

Re: [R] Bug with writeClipboard in {utils}

2024-06-19 Thread Rui Barradas
Às 11:12 de 18/06/2024, Barthelemy Tanguy via R-help escreveu: Hello, I'm encountering what seems to be a bug when using the `writeClipboard()` function in the R {utils} package. When I try to copy text to the clipboard, I notice that I get extra characters when I try to paste it (by hand

Re: [R] Bug with writeClipboard in {utils}

2024-06-19 Thread Ivan Krylov via R-help
В Tue, 18 Jun 2024 10:12:04 + Barthelemy Tanguy via R-help пишет: > #> [1] "plot(AirPassengers)" "⤀攀" > #> [1] "plot(AirPassengers)" "\u0a00" > #> [1] "plot(AirPassengers)" "\xed\xb0\x80ư" Thanks for showing an example! I was able to reproduce it both with R-4.3.1 on Windows 7 and with a

[R] Bug with writeClipboard in {utils}

2024-06-19 Thread Barthelemy Tanguy via R-help
Hello, I'm encountering what seems to be a bug when using the `writeClipboard()` function in the R {utils} package. When I try to copy text to the clipboard, I notice that I get extra characters when I try to paste it (by hand with CTRL+V or with the `readClipboard()` function from R packages

Re: [R] I have Problem using the Pipe Command

2024-06-19 Thread Richard O'Keefe
You can get an external 1TB hard drive for NZD 60 if you shop around. That's USD 37 or GBP 29. How much data do you have and how valuable? You don't need a whole 'nother laptop to backup! If you did, you could get a 2nd-hand laptop adequate for the purpose for NZD 150 (USD 92, GBP 72). Again, how

[R] PROBLEM RESOLED::code for year month day hr format

2024-06-19 Thread Jibrin Alhassan
The help I sought on code for year month day and hr format for solar wind hourly data has been resolved. Thank you all for your time, patience and wonderful contributions. Jibrin Alhassan. On Mon, Jun 17, 2024, 9:26 PM Jibrin Alhassan wrote: > Hello Rui, > Thanks for your kind and unrelenting

Re: [R] Integration of functions with a vector argument

2024-06-19 Thread Levine, Michael
Dear Ivan, Sorry for my slow response. Your advice works well; however, as you predicted, the time it takes to obtain any results is completely unacceptable (for example, a sequence of integrations we discussed is done once per iteration and even one iteration takes about 2 hours to complete).

Re: [R] I have Problem using the Pipe Command

2024-06-19 Thread Ogbos Okike
Dear Martin, I agree with you. I am anxious to upgrade. But I am afraid of losing some data on my only one system. I do not have enough backup. I am planning to buy a backup laptop before venturing to upgrade. But if there is any possibility of upgrading without losing my documents/data, I would

[R] I have Problem using the Pipe Command: PROBLEM SOLVED!

2024-06-19 Thread Ogbos Okike
Dear Eric, This is too great! I quickly changed |> to %>% and it worked like margic. Ben suggested that earlier but I thought I had to open the installed 'magrittr' with gedit in order to edit it. Following your pointers now, I simply changed the |> in my code to %>% to I have great success and

Re: [R] I have Problem using the Pipe Command

2024-06-19 Thread Martin Maechler
> Duncan Murdoch > on Tue, 18 Jun 2024 12:25:49 -0400 writes: > On 2024-06-18 12:17 p.m., Ben Bolker wrote: >> You probably have to update your R version. The native pipe |> wasn't >> introduced until R version 4.4. R.version.string (among others) will >> tell you

Re: [R] I have Problem using the Pipe Command

2024-06-19 Thread Eric Berger
So all is good. You are successfully using the R pipe %>% (before it became part of R). If you want to use the newer pipe that is part of R, i.e. |> instead of %>% you will have to install a more recent version of R. Your previous email with sessionInfo() showed that you are using R version 3.4.4

Re: [R] I have Problem using the Pipe Command

2024-06-19 Thread Eric Berger
In your R session do library(magrittr) 1:10 %>% sum() This should output 55. If that does not work send the results, include the output of sessionInfo() showing that you have loaded magrittr. On Wed, Jun 19, 2024 at 9:43 AM Ogbos Okike wrote: > Dear Eric, > Good morning from Nigeria. > >

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Eric Berger
Please show the output of > sessionInfo() On Tue, Jun 18, 2024 at 7:49 PM Ogbos Okike wrote: > Thanks, Duncan for contributing. I quickly tried entering the command on a > new line. But the error pointed specifically to the point. It didn't run. > Best regards > Ogbos > > On Tue, Jun 18, 2024

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Ogbos Okike
Thanks, Duncan for contributing. I quickly tried entering the command on a new line. But the error pointed specifically to the point. It didn't run. Best regards Ogbos On Tue, Jun 18, 2024 at 5:38 PM Duncan Murdoch wrote: > On 2024-06-18 12:17 p.m., Ben Bolker wrote: > > You probably have

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Ogbos Okike
Yes, Ben and others. Many thanks for your swift response. I have quickly installed the 'magrittr' package. It was installed successfully. But I tried to edit it using EDIT(magrittr). But it didn't work. Please, guide me further on how to edit it. Thank you very much. Ogbos On Tue, Jun 18, 2024

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Duncan Murdoch
On 2024-06-18 12:17 p.m., Ben Bolker wrote: You probably have to update your R version. The native pipe |> wasn't introduced until R version 4.4. R.version.string (among others) will tell you what version you have. Typo: it was introduced in R 4.1.0. Another possible problem is with line

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Iris Simmons
My guess would be that you're using an older version of R. The pipe was added in R 4.1. It cannot be used in earlier versions as the syntax is invalid. You could use the dplyr pipe if you want further back compatibility. On Tue, Jun 18, 2024, 12:14 Ogbos Okike wrote: > Greetings to everyone and

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Ben Bolker
You probably have to update your R version. The native pipe |> wasn't introduced until R version 4.4. R.version.string (among others) will tell you what version you have. If you don't want to do that, install and load the 'magrittr' package and change |> to %>% everywhere. On

[R] I have Problem using the Pipe Command

2024-06-18 Thread Ogbos Okike
Greetings to everyone and thank you for your readiness to help. I have problems using the pipe command (|>). Once I have it in any script on my system, it won't. The error message will say: unexpected '>' I loaded the two packages below to see if it would handle it. But the problem remains.

Re: [R] Column names of model.matrix's output with contrast.arg

2024-06-17 Thread John Fox
Dear Christophe and Ben, Also see the car package for replacements for contr.treatment(), contr.sum(), and contr.helmert() -- e.g., help("contr.Sum", package="car"). These functions have been in the car package for more than two decades, and AFAIK, no one uses them (including myself). I

Re: [R] Column names of model.matrix's output with contrast.arg

2024-06-17 Thread Ben Bolker
It's sorta-kinda-obliquely-partially documented in the examples: zapsmall(cP <- contr.poly(3)) # Linear and Quadratic output: .L .Q [1,] -0.7071068 0.4082483 [2,] 0.000 -0.8164966 [3,] 0.7071068 0.4082483 FWIW the faux package provides better-named alternatives.

Re: [R] code for year month day hr format

2024-06-17 Thread Jibrin Alhassan
Hello Rui, Thanks for your kind and unrelenting help. The code works actually. I will see what to do to sort things out. Please, accept my indebtedness. *Jibrin Adejoh Alhassan (Ph.D)* Department of Physics and Astronomy, University of Nigeria, Nsukka On Mon, Jun 17, 2024 at 8:53 PM Rui Barradas

Re: [R] Column names of model.matrix's output with contrast.arg

2024-06-17 Thread Christophe Dutang
Thanks for your reply. It might good to document the naming convention in ?contrasts. It is hard to understand .L for linear, .Q for quadratic, .C for cubic and ^n for other degrees. For contr.sum, we could have used .Sum, .Sum… Maybe the examples ?model.matrix should use names in dd objects

Re: [R] code for year month day hr format

2024-06-17 Thread Rui Barradas
Às 09:44 de 17/06/2024, Jibrin Alhassan escreveu: Hello Rui, The df1 output printed from June instead of January .Here is part of it. 4288 2012-06-27 15 6.2 420 70 -7 109.9 4289 2012-06-27 16 6.5 442 70 -9 109.9 4290 2012-06-27 17 6.3 450 70 -6 109.9 4291 2012-06-27 18 6.0

[R] unable to get barchart of censored subjects from ggsurvplot() in survminer package, if there is no predcitor

2024-06-17 Thread Christopher W. Ryan via R-help
Hello. Running R 4.2.3 on Windows 10. Using survimer package version survminer_0.4.9 published 2021-03-09. I'm encountering an error with ggsurvplot() in the survminer package. Email to the author/maintainer about 2 weeks ago has not yet resulted in a reply. I seem unable to produce a

Re: [R] What is the HEX code for "transparent" color?

2024-06-17 Thread Gabor Grothendieck
adjustcolor("#123456", alpha = 0.5) will return the indicated color with an alpha transparency of 50% . On Thu, Jun 6, 2024 at 11:07 AM Yosu Yurramendi wrote: > > What is the HEX code for "transparent" color? > I've tried "" "FF00" "", but they don't work. > Thanks > >

Re: [R] What is the HEX code for "transparent" color?

2024-06-17 Thread Yosu Yurramendi
Thank you all very much for the answers given (Greg, Robert, Duncan, Roland). Actually, I had tried with "#" and "#FF00" (I had a mistake in the message). For example it works with: numrows <- 3; numcols <- 3 a <- c(1,0,1,1,1,1,1,0,1) (pattern <- matrix(a, numrows, numcols,

Re: [R] Help trying to understand R documentation on libraries paths

2024-06-17 Thread peter dalgaard
I am not going to search the sources for it (your problem, your work ;-) ), but the wording would be consistent with a call like .libPaths(c(Sys.getenv("R_LIBS"), Sys.getenv("R_LIBS_USER"))) -pd > On 17 Jun 2024, at 13:40 , Iago Giné Vázquez wrote: > > Thanks, > > Regarding .libPaths, I am

Re: [R] Help trying to understand R documentation on libraries paths

2024-06-17 Thread Iago Giné Vázquez
Thanks, Regarding .libPaths, I am asking for the call to `.libPaths()`, so I understand there is no `new` in the call, as in the documentation I cited. Iago De: peter dalgaard Enviat el: dilluns, 17 de juny de 2024 13:26 Per a: Iago Gin� V�zquez A/c:

Re: [R] Help trying to understand R documentation on libraries paths

2024-06-17 Thread peter dalgaard
(Inline) > On 17 Jun 2024, at 09:51 , Iago Giné Vázquez wrote: > > Hi, > > 1 - On help(".libPaths", help_type = "text") one can read: > > First, '.Library.site' is initialized from 'R_LIBS_SITE'. > > However, I have > >> Sys.getenv("R_LIBS_SITE") > [1]

Re: [R] code for year month day hr format

2024-06-17 Thread Jibrin Alhassan
Hello Rui, The df1 output printed from June instead of January .Here is part of it. 4288 2012-06-27 15 6.2 420 70 -7 109.9 4289 2012-06-27 16 6.5 442 70 -9 109.9 4290 2012-06-27 17 6.3 450 70 -6 109.9 4291 2012-06-27 18 6.0 453 700 109.9 4292 2012-06-27 19 6.7 473 70

Re: [R] code for year month day hr format

2024-06-17 Thread Rui Barradas
Às 09:12 de 17/06/2024, Jibrin Alhassan escreveu: Hello Rui, Here is the head(df1) output Date HR IMF SWS SSN Dst f10.7 1 2012-01-01 0 4.0 379 71 -8 999.9 2 2012-01-01 1 4.4 386 71 -3 999.9 3 2012-01-01 2 4.8 380 71 -4 999.9 4 2012-01-01 3 5.4 374 71 -5 999.9 5 2012-01-01 4 4.5 369

Re: [R] code for year month day hr format

2024-06-17 Thread Jibrin Alhassan
Hello Rui, Here is the head(df1) output Date HR IMF SWS SSN Dst f10.7 1 2012-01-01 0 4.0 379 71 -8 999.9 2 2012-01-01 1 4.4 386 71 -3 999.9 3 2012-01-01 2 4.8 380 71 -4 999.9 4 2012-01-01 3 5.4 374 71 -5 999.9 5 2012-01-01 4 4.5 369 71 -9 999.9 6 2012-01-01 5 4.2 368 71 -7 999.9

[R] Help trying to understand R documentation on libraries paths

2024-06-17 Thread Iago Giné Vázquez
Hi, 1 - On help(".libPaths", help_type = "text") one can read: First, '.Library.site' is initialized from 'R_LIBS_SITE'. However, I have > Sys.getenv("R_LIBS_SITE") [1] "c:/Users/i.gine/AppData/Local/Programs/R/R-4.4.1/site-library" > .Library.site character(0) Is this consistent? 2 - Next,

Re: [R] code for year month day hr format

2024-06-17 Thread Rui Barradas
Às 07:53 de 17/06/2024, Jibrin Alhassan escreveu: Part of it is pasted below YEAR DOY HRIMF SWS SSN Dst f10.7 2012 1 0 4.0 379. 71-8 999.9 2012 1 1 4.4 386. 71-3 999.9 2012 1 2 4.8 380. 71-4 999.9 2012 1 3 5.4 374. 71-5 999.9 2012 1 4 4.5

Re: [R] code for year month day hr format

2024-06-17 Thread Jibrin Alhassan
Part of it is pasted below YEAR DOY HRIMF SWS SSN Dst f10.7 2012 1 0 4.0 379. 71-8 999.9 2012 1 1 4.4 386. 71-3 999.9 2012 1 2 4.8 380. 71-4 999.9 2012 1 3 5.4 374. 71-5 999.9 2012 1 4 4.5 369. 71-9 999.9 2012 1 5 4.2 368. 71

Re: [R] code for year month day hr format

2024-06-17 Thread Jibrin Alhassan
Hello Rui, Your patience is indeed amazing. Your script tested as shown below worked perfectly well. df1 <- read.table(text = "YEAR DOY HR IMF SW SSNDst f10.7 2012 215 4 5.1 371. 143-4 138.6 ", header = TRUE) with(df1, paste(YEAR, DOY)) |> as.Date(format = "%Y %j") df1$Date <-

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread Laurent Rhelp
Thank you for this solution which is faster than the two for loops. gloop <- function(N1,N2,ratio_sampling,vec1,vec2){   ix <- seq_along(vec2)   S_diff2 <- sapply(seq_len(N1-(N2-1)*ratio_sampling), \(j)     sum((vec1[(ix-1)*ratio_sampling+j] - vec2[ix])**2))   return(S_diff2)

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread Gabor Grothendieck
This can be vectorized. Try ix <- seq_along(vec2) S_diff2 <- sapply(seq_len(N1-(N2-1)*ratio_sampling), \(j) sum((vec1[(ix-1)*ratio_sampling+j] - vec2[ix])**2)) On Sun, Jun 16, 2024 at 11:27 AM Laurent Rhelp wrote: > > Dear RHelp-list, > > I try to use the package comprehenr to replace a

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread Laurent Rhelp
Avi and Jeff, Thank you very much for your answers. I did not think I would get such an interessing answer when I asked my question. In fact, I discovered recently the list comprehension reading some python code and I was seduced but the compact notation so I decided to do an exercice on an

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread avi.e.gross
I fully agree with Jeff that the best way to use ANY language is to evaluate the language in terms of not just the capabilities it offers but also the philosophy behind what it was created for and how people do things and just grok it and use it mostly in the way intended. I do that with all the

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread Jeff Newmiller via R-help
I would be more strong on this advice: learn to think in R, rather than thinking in Python, when programming in R. R has atomic vectors... Python does not (until you import a package that implements them). I find that while it is possible to import R thinking into Python, Python programmers

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread avi.e.gross
Laurent, Thank you for introducing me to a package I did not know existed as I use features like list comprehension in python all the time and could see using it in R now that I know it is available. As to why you see your example as slow, I see you used a fairly complex and nested expression

[R] slowness when I use a list comprehension

2024-06-16 Thread Laurent Rhelp
Dear RHelp-list,    I try to use the package comprehenr to replace a for loop by a list comprehension.  I wrote the code but I certainly miss something because it is very slower compared to the for loops. May you please explain to me why the list comprehension is slower in my case. Here

Re: [R] code for year month day hr format

2024-06-16 Thread Rolf Turner
On Sun, 16 Jun 2024 08:33:03 +0100 Rui Barradas wrote: > Hello, > > There is an error in your new code: > > > paste YEAR with DOY, not with HR. > > > As for the rest, is your real data like the one you posted before? > If it is then I don't see anything wrong with my (tested) solution.

Re: [R] code for year month day hr format

2024-06-16 Thread Rui Barradas
Às 21:42 de 15/06/2024, Jibrin Alhassan escreveu: Thank you Rui. I ran the following script df1 <- read.table("solar_hour", header = TRUE) df1$date <- as.Date(paste(df1$year, df1$hour), format = "%Y %j", origin = "2012-08-01-0") df2 <- df1[c("date", "IMF", "SWS", "SSN", "Dst", "f10")]

Re: [R] code for year month day hr format

2024-06-15 Thread Jeff Newmiller via R-help
Please run your sequence of R statements one at a time so you can tell where the problem is. Only "run a script" after the code works one line at a time. There are too many places where things can go wrong otherwise. Is your file being read in properly? Is the filename correct? was the header

Re: [R] code for year month day hr format

2024-06-15 Thread Jibrin Alhassan
Thank you Rui. I ran the following script df1 <- read.table("solar_hour", header = TRUE) df1$date <- as.Date(paste(df1$year, df1$hour), format = "%Y %j", origin = "2012-08-01-0") df2 <- df1[c("date", "IMF", "SWS", "SSN", "Dst", "f10")] head(df1) #To display all the rows print(df2). It gave me

Re: [R] code for year month day hr format

2024-06-15 Thread Ebert,Timothy Aaron
library(lubridate) library(dplyr) df1 <- read.table(text = "YEAR DOY HR IMF SW SSNDst f10.7 2012 214 0 3.4 403. 132-9 154.6 2012 214 1 3.7 388. 132 -10 154.6 2012 214 2 3.7 383. 132 -10 154.6 2012 214 3 3.7 391. 132-9 154.6 2012 215 4 5.1 371. 143-4

Re: [R] code for year month day hr format

2024-06-15 Thread Rui Barradas
Às 20:00 de 15/06/2024, Jibrin Alhassan escreveu: I have solar-geophysical data e.g as blow: YEAR DOY HR IMF SW SSNDst f10.7 2012 214 0 3.4 403. 132-9 154.6 2012 214 1 3.7 388. 132 -10 154.6 2012 214 2 3.7 383. 132 -10 154.6 2012 214 3 3.7 391. 132-9 154.6

[R] code for year month day hr format

2024-06-15 Thread Jibrin Alhassan
I have solar-geophysical data e.g as blow: YEAR DOY HR IMF SW SSNDst f10.7 2012 214 0 3.4 403. 132-9 154.6 2012 214 1 3.7 388. 132 -10 154.6 2012 214 2 3.7 383. 132 -10 154.6 2012 214 3 3.7 391. 132-9 154.6 2012 214 4 4.2 399. 132-7 154.6 2012 214 5

Re: [R] Column names of model.matrix's output with contrast.arg

2024-06-14 Thread peter dalgaard
You're at the mercy of the various contr.XXX functions. They may or may not set the colnames on the matrices that they generate. The rationales for (not) setting them is not perfectly transparent, but you obviously cannot use level names on contr.poly, so it uses .L, .Q, etc. In MASS,

[R] [Rd] R 4.4.1 is released

2024-06-14 Thread peter dalgaard
The build system rolled up R-4.4.1.tar.gz (codename "Race for Your Life") this morning. === This release is dedicated to the memory of Friedrich (Fritz) Leisch, 1968-2024.

[R] Column names of model.matrix's output with contrast.arg

2024-06-14 Thread Christophe Dutang
Dear list, Changing the default contrasts used in glm() makes me aware how model.matrix() set column names. With default contrasts, model.matrix() use the level values to name the columns. However with other contrasts, model.matrix() use the level indexes. In the documentation, I don’t see

[R-es] inscribir

2024-06-13 Thread David López
[[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] Create a numeric series in an efficient way

2024-06-13 Thread avi.e.gross
Bert, I think you read my message differently than I expected. I approached the request as an exercise in evaluating various ways something can be done and maybe choosing a simple one or choosing a more general one as needed. I provided some solutions along the lines you mentioned and THEN

Re: [R] Create a numeric series in an efficient way

2024-06-13 Thread Bert Gunter
"If you want a much more compact solution that handles arbitrary pairs of "what to copy", number_of_copies, you can write a function that evaluates two arguments at a time or takes two vectors as arguments like this one I wrote quickly and crudely:" Please! -- The "times" argument of rep can be

Re: [R] Create a numeric series in an efficient way

2024-06-13 Thread avi.e.gross
For the particular example you asked for, consider the "each" you can use with rep() rep(1:13, each=84) This is what it does for a shorter version of 4 each: > rep(1:13, each=4) [1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8 9 9 9 9 10 10

Re: [R] Create a numeric series in an efficient way

2024-06-13 Thread Ebert,Timothy Aaron
Thank you. Using ‘each’ is shorter code, so better if the requested order was important versus being an initial solution. blocC <- c(rep(x=c(1:13), times=84)) #it makes 84 copies of the numbers 1:13 blocC <- arrange(.data = data.frame(blocC), blocC) #sort to get requested order. blocD <-

Re: [R] Create a numeric series in an efficient way

2024-06-13 Thread Bert Gunter
Nope. She would have wanted the 'each' argument = 84. See ?rep. -- Bert On Thu, Jun 13, 2024 at 3:54 PM Ebert,Timothy Aaron wrote: > Maybe this was your solution? > > blocC <- c(rep(x=c(1:13), times=84)) > blocC <- arrange(.data = data.frame(blocC), blocC) > > The second line sorts, but that

Re: [R] Create a numeric series in an efficient way

2024-06-13 Thread Ebert,Timothy Aaron
Maybe this was your solution? blocC <- c(rep(x=c(1:13), times=84)) blocC <- arrange(.data = data.frame(blocC), blocC) The second line sorts, but that may not be needed depending on application. The object class is also different in the sorted solution. Tim -Original Message- From:

Re: [R] Create a numeric series in an efficient way

2024-06-13 Thread Francesca PANCOTTO via R-help
I apologize, I solved the problem, sorry for that. f. Il giorno gio 13 giu 2024 alle ore 16:42 Francesca PANCOTTO < francesca.panco...@unimore.it> ha scritto: > Dear Contributors > I am trying to create a numeric series with repeated numbers, not > difficult task, but I do not seem to find an

[R] Create a numeric series in an efficient way

2024-06-13 Thread Francesca PANCOTTO via R-help
Dear Contributors I am trying to create a numeric series with repeated numbers, not difficult task, but I do not seem to find an efficient way. This is my solution blocB <- c(rep(x = 1, times = 84), rep(x = 2, times = 84), rep(x = 3, times = 84), rep(x = 4, times = 84), rep(x = 5, times = 84),

Re: [R] Integration of functions with a vector argument

2024-06-13 Thread Ivan Krylov via R-help
В Wed, 12 Jun 2024 23:42:18 + "Levine, Michael" пишет: > f.int1 <- function(x,y) {Vectorize (function(y) f(c(x,y),H=H,j=j))} Vectorize returns a callable function(y), so wrapping it in a function(x,y) will not work. Since you'd like to integrate over y, we can perform the same

Re: [R] Integration of functions with a vector argument

2024-06-13 Thread Levine, Michael
Dear Ivan, Thank you very much for your suggestions. I understand what you are saying. I am afraid I didn't explain well enough what was needed, however. Let us again restrict ourselves to the case of two dimensions. Then, what I have is a bivariate density function f(x,y) and my intention is

Re: [R] Integration of functions with a vector argument

2024-06-13 Thread Jeff Newmiller via R-help
How do you integrate perpendicular to a plane if you don't have a concept of 3d? In that direction the plane is just a point. Vectors in R do not have any concept of "n by 1"... they are like a string of beads. When you take a column out of a matrix `a` using indexing b <- a[,j] the resulting

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Rui Barradas
Às 20:44 de 12/06/2024, Yuan Chun Ding escreveu: Hi Rui, Thank you very much! Yes, I verified using real data, it worked correctly as expected after adding tidyr:: to the pivot_longer function and dplyr:: to the group_by and summarize Function. I did not know how to assign the tidyr and

Re: [R-es] Congreso R Sevilla 2024: envío de comunicaciones hasta el próximo sábado 15 de junio

2024-06-12 Thread Francisco Rodríguez
De: R-help-es en nombre de Francisco Rodríguez Enviado: miércoles, 12 de junio de 2024 22:22 Para: Francisco Rodriguez Sanchez ; r-help-es@r-project.org Asunto: Re: [R-es] Congreso R Sevilla 2024: envío de comunicaciones hasta el próximo sábado 15 de junio

Re: [R-es] Congreso R Sevilla 2024: envío de comunicaciones hasta el próximo sábado 15 de junio

2024-06-12 Thread Francisco Rodríguez
Hola buenas tardes, En mi caso solicit� para dar un taller, supongo que todo est� en orden. Un saludo y gracias De: R-help-es en nombre de Francisco Rodriguez Sanchez Enviado: mi�rcoles, 12 de junio de 2024 12:04 Para: r-help-es@r-project.org Asunto: [R-es]

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Yuan Chun Ding via R-help
Hi Rui, Thank you very much! Yes, I verified using real data, it worked correctly as expected after adding tidyr:: to the pivot_longer function and dplyr:: to the group_by and summarize Function. I did not know how to assign the tidyr and dplyr to the three functions because I do not really

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Rui Barradas
Hello, Inline. Às 19:03 de 12/06/2024, Yuan Chun Ding via R-help escreveu: I am sorry that I know I should provide a dataset that allows to replicate my problem. It is a research dataset and quite large, so I can not share. Both Bert and Tim guessed my problem correctly. I also thought

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Yuan Chun Ding via R-help
I am sorry that I know I should provide a dataset that allows to replicate my problem. It is a research dataset and quite large, so I can not share. Both Bert and Tim guessed my problem correctly. I also thought about the conflicting issue between different packages and function masking. I

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread CALUM POLWART
I sometimes think people on this list are quite rude to posters. I'm afraid I'm likely to join in with some rudeness? 1. "Here is some code that works but also doesn't" is probably not going to get you an answer 2. I provide no information about the data it works on or doesn't 3. I tell you I'm

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Ebert,Timothy Aaron
Hi Yuan, When you load some packages do you get messages saying that some function is being masked? What can happen is that one package has a function with the same name as another package. The conflict is resolved by having one package mask the other. However, this can cause conflicts if

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Bert Gunter
I am assuming from your message that *exactly* the same code you show was rerun and yielded different results. If that be so, I doubt that this can be answered without knowing what that other R code did -- and perhaps not even then -- and/or whether any of that code changed your data frame.

[R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Yuan Chun Ding via R-help
Hi R users, The following code worked well to summarize four data groups in a dataframe for three variables (t_depth, t_alt_count, t_alt_ratio), 12 columns of summary, see attached. However, after running another 2000 lines of R codes using functions from more than 10 other R libraries, then

Re: [R] Integration of functions with a vector argument

2024-06-12 Thread Ivan Krylov via R-help
В Tue, 11 Jun 2024 18:44:08 + "Levine, Michael" пишет: > Let us say we have a function > > F <- function(x){ body of the function} > > Where x is, in general, a d by 1 vector with d>1. Now I want to > integrate out some of the coordinates of x, e.g. x[1] or x[2] or both > of them etc. I'm

[R-es] Congreso R Sevilla 2024: envío de comunicaciones hasta el próximo sábado 15 de junio

2024-06-12 Thread Francisco Rodriguez Sanchez
Buenos días Este sábado (15 de junio) se cierra el plazo para enviar comunicaciones para el próximo congreso de R en Sevilla (noviembre de 2024). Gran oportunidad para presentar nuestro trabajo y aprender, con charlas y talleres sobre datos, estadística, programación, docencia, tidymodels,

[R] Integration of functions with a vector argument

2024-06-12 Thread Levine, Michael
Hello all, I have a question concerning integration of a function of a multivariate argument with respect to one or more variables in r. Let us say we have a function F <- function(x){ body of the function} Where x is, in general, a d by 1 vector with d>1. Now I want to integrate out some

[R] Fwd: Webinar: How to access ERDDAP data using R

2024-06-11 Thread Roy Mendelssohn - NOAA Federal via R-help
> > > > > > > Note | June 2024 > > > > > Webinar announcement > > How to access ERDDAP data using R > > > > > 20 June 2024 | 18:00

Re: [R] Format

2024-06-10 Thread Eric Berger
Since you are loading lubridate it is enough to do Atest$ddate1 <- dmy(Atest$ddate) On Sun, Jun 9, 2024 at 11:59 PM Duncan Murdoch wrote: > > On 2024-06-09 4:39 p.m., Val wrote: > > HI all, > > > > My > > I am trying to convert character date (mm/dd/yy) to -mm-dd date > > format in one

Re: [R] Format

2024-06-09 Thread Duncan Murdoch
On 2024-06-09 4:39 p.m., Val wrote: HI all, My I am trying to convert character date (mm/dd/yy) to -mm-dd date format in one of the columns of my data file. The first few lines of the data file looks like as follow head(Atest,10);dim(Atest) ddate 1 19/08/21 2 30/04/18 Those

Re: [R] Format

2024-06-09 Thread Rui Barradas
Às 21:39 de 09/06/2024, Val escreveu: HI all, My I am trying to convert character date (mm/dd/yy) to -mm-dd date format in one of the columns of my data file. The first few lines of the data file looks like as follow head(Atest,10);dim(Atest) ddate 1 19/08/21 2 30/04/18 3

[R] Format

2024-06-09 Thread Val
HI all, My I am trying to convert character date (mm/dd/yy) to -mm-dd date format in one of the columns of my data file. The first few lines of the data file looks like as follow head(Atest,10);dim(Atest) ddate 1 19/08/21 2 30/04/18 3 28/08/21 4 11/10/21 5 07/09/21 6 15/08/21

Re: [R] Can't compute row means of two columns of a dataframe.

2024-06-08 Thread Ebert,Timothy Aaron
Would this work? xxxz$Average20 <- (xxxz$Low20 + xxxz$High20)/2 I tried this earlier but it does not appear to have gone through. Tim -Original Message- From: R-help On Behalf Of avi.e.gr...@gmail.com Sent: Saturday, June 8, 2024 2:16 PM To: 'Sorkin, John' ; r-help@r-project.org

  1   2   3   4   5   6   7   8   9   10   >