Re: [R] mclapply enters into an infinite loop....

2023-05-16 Thread Jeff Newmiller
It does not look to me like you are providing the necessary arguments to arfima.

Try making this work with lapply first... then try mclapply.

On May 16, 2023 3:10:45 PM PDT, akshay kulkarni  wrote:
>Dear members,
> I am using arfima in an mclapply construction (from 
> the parallel package):
>
>Browse[2]> LYG <- mclapply(LYGH, FUN = arfima, mc.cores = detectCores())
>^C
>Browse[2]> LYG <- mclapply(LYGH[1:10], FUN = arfima, mc.cores = detectCores())
>^C
>Browse[2]> LYG <- mclapply(LYGH[1:2], FUN = arfima, mc.cores = detectCores())
>^C
>
>You can see that I am aborting the execution of mclapply. It doesn't finish 
>even if I reduce the elements to be iterated over to 2. Why is it entering an 
>infinite loop?
>
>Please exhort me if this is to be posted in HPC list.
>
>THanking you,
>Yours sincerely,
>ALSHAY M KULKARNI
>
>   [[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.

-- 
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] Recombining Mon and Year values

2023-05-16 Thread Jeff Newmiller
I don't use lubridate, but that package works with Date and POSIXt types, which 
I do use. Just remember to include a day when converting (1st of month is 
typical), and use an output format to hide the day when you plot.

On May 16, 2023 1:29:27 PM PDT, Jeff Reichman  wrote:
>R Help
>
> 
>
>I have a data.frame where I've broken out the year  and an ordered
>month  values. But I need to recombine them so I can graph mon-year in
>order but when I recombine I lose the month order and the results are
>plotted alphabetical.
>
> 
>
>Yearmonth  mon_year
>
>  
>
>2021 MarMar-2021
>
>2021 Jan Jan-2021
>
>2021 Apr Apr-2021
>
> 
>
>So do I need to convert the months back to an integer then recombine to
>plot.
>
> 
>
>Jeff Reichman
>
>
>   [[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.

-- 
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] Recombining Mon and Year values

2023-05-16 Thread Jeff Reichman
Ah the zoo package! I was trying with lubridate package.

-Original Message-
From: Rui Barradas  
Sent: Tuesday, May 16, 2023 5:04 PM
To: Jeff Reichman ; r-help@r-project.org
Subject: Re: [R] Recombining Mon and Year values

Às 21:29 de 16/05/2023, Jeff Reichman escreveu:
> R Help
> 
>   
> 
> I have a data.frame where I've broken out the year  and an 
> ordered month  values. But I need to recombine them so I can 
> graph mon-year in order but when I recombine I lose the month order 
> and the results are plotted alphabetical.
> 
>   
> 
> Yearmonth  mon_year
> 
>  
> 
> 2021 MarMar-2021
> 
> 2021 Jan Jan-2021
> 
> 2021 Apr Apr-2021
> 
>   
> 
> So do I need to convert the months back to an integer then recombine 
> to plot.
> 
>   
> 
> Jeff Reichman
> 
> 
>   [[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.
Hello,

You can use function as.yearmon in package zoo to get the correct month/year 
order.



df1 <- data.frame(Year = c(2021, 2021, 2021),
   Mon = c("Mar", "Jan", "Apr"))

df1$mon_year <- zoo::as.yearmon(paste(df1$Mon, df1$Year))

sort(df1$mon_year)
#> [1] "Jan 2021" "Mar 2021" "Apr 2021"



Hope this helps,

Rui Barradas

__
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] mclapply enters into an infinite loop....

2023-05-16 Thread akshay kulkarni
Dear members,
 I am using arfima in an mclapply construction (from 
the parallel package):

Browse[2]> LYG <- mclapply(LYGH, FUN = arfima, mc.cores = detectCores())
^C
Browse[2]> LYG <- mclapply(LYGH[1:10], FUN = arfima, mc.cores = detectCores())
^C
Browse[2]> LYG <- mclapply(LYGH[1:2], FUN = arfima, mc.cores = detectCores())
^C

You can see that I am aborting the execution of mclapply. It doesn't finish 
even if I reduce the elements to be iterated over to 2. Why is it entering an 
infinite loop?

Please exhort me if this is to be posted in HPC list.

THanking you,
Yours sincerely,
ALSHAY M KULKARNI

[[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] Recombining Mon and Year values

2023-05-16 Thread Rui Barradas

Às 21:29 de 16/05/2023, Jeff Reichman escreveu:

R Help

  


I have a data.frame where I've broken out the year  and an ordered
month  values. But I need to recombine them so I can graph mon-year in
order but when I recombine I lose the month order and the results are
plotted alphabetical.

  


Yearmonth  mon_year

 

2021 MarMar-2021

2021 Jan Jan-2021

2021 Apr Apr-2021

  


So do I need to convert the months back to an integer then recombine to
plot.

  


Jeff Reichman


[[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.

Hello,

You can use function as.yearmon in package zoo to get the correct 
month/year order.




df1 <- data.frame(Year = c(2021, 2021, 2021),
  Mon = c("Mar", "Jan", "Apr"))

df1$mon_year <- zoo::as.yearmon(paste(df1$Mon, df1$Year))

sort(df1$mon_year)
#> [1] "Jan 2021" "Mar 2021" "Apr 2021"



Hope this helps,

Rui Barradas

__
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] Recombining Mon and Year values

2023-05-16 Thread Bert Gunter
There are many ways to do this in various R packages. Search on "Plot
month-year data in R" or the like and choose that which works best for you.
There may be a learning curve involved, naturally.

(Note: you may wish to check out zoo:yearmon and zoo:autoplot first, as
these seem like they might be a good fit to your task. You decide, of
course.)

-- Bert

On Tue, May 16, 2023 at 1:37 PM Jeff Reichman 
wrote:

> R Help
>
>
>
> I have a data.frame where I've broken out the year  and an ordered
> month  values. But I need to recombine them so I can graph mon-year in
> order but when I recombine I lose the month order and the results are
> plotted alphabetical.
>
>
>
> Yearmonth  mon_year
>
>  
>
> 2021 MarMar-2021
>
> 2021 Jan Jan-2021
>
> 2021 Apr Apr-2021
>
>
>
> So do I need to convert the months back to an integer then recombine to
> plot.
>
>
>
> Jeff Reichman
>
>
> [[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.
>

[[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.


[R] Recombining Mon and Year values

2023-05-16 Thread Jeff Reichman
R Help

 

I have a data.frame where I've broken out the year  and an ordered
month  values. But I need to recombine them so I can graph mon-year in
order but when I recombine I lose the month order and the results are
plotted alphabetical.

 

Yearmonth  mon_year

  

2021 MarMar-2021

2021 Jan Jan-2021

2021 Apr Apr-2021

 

So do I need to convert the months back to an integer then recombine to
plot.

 

Jeff Reichman


[[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] [External Email] Newbie: Controlling legends in graphs

2023-05-16 Thread Kevin Zembower via R-help
See below.

On 5/16/23 10:52, Christopher Ryan wrote:
> I"m more of a lattice guy than a ggplot guy, but perhaps this is part of 
> the problem:
> 
> .
>       geom_point(aes(y = m_K, color = "red")) +  # >> you've
> associated "K" with the color red
>       geom_smooth(aes(y = m_K, color = "red")) +
>       geom_point(aes(y = m_J, color = "blue")) +   ## >> and "J"
> with the color blue
>       geom_smooth(aes(y = m_J, color = "blue")) +
> 
> .
> 
Yes, I was confused that I associated  "K" with the color red, yet the 
line and points for K's data were blue, but in the legend, was labeled 
with the word "red".

But, I think I've got it straightened out now. Thanks for your help.

-Kevin


__
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] Newbie: Drawing fitted lines on subset of data

2023-05-16 Thread Kevin Zembower via R-help
Yep, that did it. I didn't know that you could have pipelines within 
pipelines.

Thanks, again, for all your help.

-Kevin

On 5/16/23 11:44, Rui Barradas wrote:
> Às 15:29 de 16/05/2023, Kevin Zembower via R-help escreveu:
>> Hello,
>>
>> I's still working with my tsibble of weight data for the last 20 years.
>> In addition to drawing an overall trend line, using lm, for the whole
>> data set, I'd like to draw short lines that would recompute lm and draw
>> it, say, just for the years from 2010:2015.
>>
>> Here's a short example that I think illustrates what I'm trying to do.
>> The commented out sections show what I've tried to far:
>>
>> ## Short example to test segments:
>>
>> w <- tsibble(
>>   date = as.Date("2022-01-01") + 0:99,
>>   value = rnorm(100)
>> )
>>
>> ggplot(data = w, mapping = aes(date, value)) +
>>   geom_smooth(method = "lm", se = FALSE) +
>>   geom_point()
>>   ## Below gives error about ignoring data
>>   ## geom_abline( data = w$date[25:75] )
>>   ## Gives error ''data' must be in '
>>   ## geom_smooth(data = w$date[25:35],
>>   ## method = lm,
>>   ## color = "black",
>>   ## se = FALSE)
>>
>> I'm thinking that this is probably easily done, but I'm struggling with
>> how to subset the data in the middle of the pipeline.
>>
>> Thanks for any advice and help.
>>
>> -Kevin
>>
>> __
>> 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.
> Hello,
> 
> Try the following.
> In the 2nd geom_smooth you need a subset of the data not of just one of 
> its columns.
> 
> 
> 
> suppressPackageStartupMessages({
>    library(tsibble)
>    library(dplyr)
>    library(ggplot2)
>    library(lubridate)
> })
> 
> ggplot(data = w, mapping = aes(date, value)) +
>    geom_smooth(formula = y ~ x, method = "lm", se = FALSE) +
>    geom_point() +
>    geom_smooth(
>      data = w %>% filter(year(date) >= 2010, year(date) <= 2015),
>      mapping = aes(date, value),
>      formula = y ~ x,
>      method = lm,
>      color = "black",
>      se = FALSE
>    )
> 
> 
> Other ways to subset the data are
> 
> 
> # dplyr
> data = w %>% filter(year(date) %in% 2010:2015)
> # base R
> data = subset(w, year(date) %in% 2010:2015)
> 
> 
> Hope this helps,
> 
> Rui Barradas
> 


__
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] Newbie: Drawing fitted lines on subset of data

2023-05-16 Thread Rui Barradas

Às 15:29 de 16/05/2023, Kevin Zembower via R-help escreveu:

Hello,

I's still working with my tsibble of weight data for the last 20 years.
In addition to drawing an overall trend line, using lm, for the whole
data set, I'd like to draw short lines that would recompute lm and draw
it, say, just for the years from 2010:2015.

Here's a short example that I think illustrates what I'm trying to do.
The commented out sections show what I've tried to far:

## Short example to test segments:

w <- tsibble(
  date = as.Date("2022-01-01") + 0:99,
  value = rnorm(100)
)

ggplot(data = w, mapping = aes(date, value)) +
  geom_smooth(method = "lm", se = FALSE) +
  geom_point()
  ## Below gives error about ignoring data
  ## geom_abline( data = w$date[25:75] )
  ## Gives error ''data' must be in '
  ## geom_smooth(data = w$date[25:35],
  ## method = lm,
  ## color = "black",
  ## se = FALSE)

I'm thinking that this is probably easily done, but I'm struggling with
how to subset the data in the middle of the pipeline.

Thanks for any advice and help.

-Kevin

__
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.

Hello,

Try the following.
In the 2nd geom_smooth you need a subset of the data not of just one of 
its columns.




suppressPackageStartupMessages({
  library(tsibble)
  library(dplyr)
  library(ggplot2)
  library(lubridate)
})

ggplot(data = w, mapping = aes(date, value)) +
  geom_smooth(formula = y ~ x, method = "lm", se = FALSE) +
  geom_point() +
  geom_smooth(
data = w %>% filter(year(date) >= 2010, year(date) <= 2015),
mapping = aes(date, value),
formula = y ~ x,
method = lm,
color = "black",
se = FALSE
  )


Other ways to subset the data are


# dplyr
data = w %>% filter(year(date) %in% 2010:2015)
# base R
data = subset(w, year(date) %in% 2010:2015)


Hope this helps,

Rui Barradas

__
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] [External Email] Newbie: Controlling legends in graphs

2023-05-16 Thread Christopher Ryan via R-help
I"m more of a lattice guy than a ggplot guy, but perhaps this is part of
the problem:

.
>  geom_point(aes(y = m_K, color = "red")) +  # >> you've
> associated "K" with the color red
>  geom_smooth(aes(y = m_K, color = "red")) +
>  geom_point(aes(y = m_J, color = "blue")) +   ## >> and "J" with
> the color blue
>  geom_smooth(aes(y = m_J, color = "blue")) +
>
.

# >> but you object about a "blue line for K" and a "red line for J"?

When this runs, the blue line for "K" is above the red line for "J", as
> I expect, but in the legend, the red is shown first, and labeled "blue."
>
> I'd like to be able to create a legend where the first entry shows a
> blue line and is labeled "K" and the second is red and labeled "J".
> Thanks for all your advice and guidance.
>
...

>
> -Kevin
>
>
> __
> 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.


[R] Newbie: Drawing fitted lines on subset of data

2023-05-16 Thread Kevin Zembower via R-help
Hello,

I's still working with my tsibble of weight data for the last 20 years. 
In addition to drawing an overall trend line, using lm, for the whole 
data set, I'd like to draw short lines that would recompute lm and draw 
it, say, just for the years from 2010:2015.

Here's a short example that I think illustrates what I'm trying to do. 
The commented out sections show what I've tried to far:

## Short example to test segments:

w <- tsibble(
 date = as.Date("2022-01-01") + 0:99,
 value = rnorm(100)
)

ggplot(data = w, mapping = aes(date, value)) +
 geom_smooth(method = "lm", se = FALSE) +
 geom_point()
 ## Below gives error about ignoring data
 ## geom_abline( data = w$date[25:75] )
 ## Gives error ''data' must be in '
 ## geom_smooth(data = w$date[25:35],
 ## method = lm,
 ## color = "black",
 ## se = FALSE)

I'm thinking that this is probably easily done, but I'm struggling with 
how to subset the data in the middle of the pipeline.

Thanks for any advice and help.

-Kevin

__
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] Newbie: Controlling legends in graphs

2023-05-16 Thread Kevin Zembower via R-help
Rui, thanks so much for your help. Your explanation and example were 
clear and concise. Thanks for taking the time and effort to help me.

-Kevin

On 5/12/23 16:06, Rui Barradas wrote:
> Às 14:24 de 12/05/2023, Kevin Zembower via R-help escreveu:
>> Hello, I'm trying to create a line graph with a legend, but have no
>> success controlling the legend. Since nothing I've tried seems to work,
>> I must be doing something systematically wrong. Can anyone point this
>> out to me?
>>
>> Here's my data:
>>   > weights
>> # A tibble: 1,246 × 3
>>  Date   J K
>>    
>>    1 2000-02-13   133  188
>>    2 2000-02-20   134  185
>>    3 2000-02-27   135  187
>>    4 2000-03-05   135  185
>>    5 2000-03-12    NA  184
>>    6 2000-03-19    NA  184.
>>    7 2000-03-26   136  184.
>>    8 2000-04-02   134  185
>>    9 2000-04-09   133  186
>> 10 2000-04-16    NA  186
>> # ℹ 1,236 more rows
>> # ℹ Use `print(n = ...)` to see more rows
>>   >
>>
>> Here's my attempts. You can see some of the things I've tried in the
>> commented out sections:
>> weights %>%
>>   group_by(year(Date)) %>%
>>   summarize(
>>   m_K = mean(K, na.rm = TRUE),
>>   m_J = mean(J, na.rm = TRUE),
>>   ) %>%
>>   ggplot(aes(x = `year(Date)`)) +
>>   geom_point(aes(y = m_K, color = "red")) +
>>   geom_smooth(aes(y = m_K, color = "red")) +
>>   geom_point(aes(y = m_J, color = "blue")) +
>>   geom_smooth(aes(y = m_J, color = "blue")) +
>>   guides(size = "legend",
>>  shape = "legend")
>>   ## scale_shape_discrete(name="Person",
>>   ##  breaks=c("m_K", "m_J"),
>>   ##  labels=c("K", "J"))
>>   ## theme(legend.title=element_blank())
>>
>> When this runs, the blue line for "K" is above the red line for "J", as
>> I expect, but in the legend, the red is shown first, and labeled "blue."
>>
>> I'd like to be able to create a legend where the first entry shows a
>> blue line and is labeled "K" and the second is red and labeled "J".
>>
>> On a different but related topic, I'd welcome any advice or suggestions
>> on my methodology in this example. Is this the correct way to summarize
>> with a mean? Do I need the two sets of geom_point and geom_line clauses
>> to create this graph, or is there a better way?
>>
>> Thanks for all your advice and guidance.
>>
>> -Kevin
>>
>>
>> __
>> 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.
> Hello,
> 
> This is mainly a data reshaping problem. Insteadof plotting two 
> variables, J and K, if the data is in the long format you will map the 
> column with these variables names to the color aesthetic and call each 
> geom_* only once. Then, assign the colors you want.
> 
> As for placing K above J, note that ggplot places them by alphabetical 
> order unless you coerce to factor with the levels in the order you want.
> 
> Also, if you want to compute aggregate statistics for several columns, 
> use ?across. See the code below.
> 
> Here is a complete example. I have augmented your data set in order to 
> have more years to plot.
> 
> 
> 
> # augment the data set
> weights <- " Date   J K
>    1 2000-02-13   133  188
>    2 2000-02-20   134  185
>    3 2000-02-27   135  187
>    4 2000-03-05   135  185
>    5 2000-03-12    NA  184
>    6 2000-03-19    NA  184.
>    7 2000-03-26   136  184.
>    8 2000-04-02   134  185
>    9 2000-04-09   133  186
> 10 2000-04-16    NA  186"
> weights <- read.table(text = weights, header = TRUE)
> weights$Date <- as.Date(weights$Date)
> tmp <- weights
> tmp <- lapply(1:10, \(y) {
>    tmp$Date <- years(y) + tmp$Date
>    tmp$J <- tmp$J + sample(-10:10, nrow(weights), TRUE)
>    tmp$K <- tmp$K + sample(-10:10, nrow(weights), TRUE)
>    tmp
> })
> weights <- do.call(rbind, tmp)
> 
> #---
> 
> # plot code
> library(ggplot2)
> library(dplyr)
> library(tidyr)
> library(lubridate)
> 
> weights %>%
>      mutate(Year = year(Date)) %>%
>      group_by(Year) %>%
>      summarize(across(J:K, mean, na.rm = TRUE)) %>%
>      # now reshape the data
>      pivot_longer(-Year) %>%
>      # uncomment the next line if you want K
>      # to show up on top in the legend
>      # mutate(name = factor(name, levels = c("K", "J"))) %>%
>      ggplot(aes(Year, value, color = name)) +
>      geom_smooth(
>      formula = y ~ x,
>      method = lm,
>      se = FALSE
>      ) +
>      geom_point() +
>      scale_color_manual(values = c(J = "red", K = "blue"))
> 
> 
> 
> Hope this helps,
> 
> Rui Barradas
> 


__
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 

Re: [R-es] Error al actualizar R 4.3.0

2023-05-16 Thread Sebastian Kruk
Hola, lo pude corregir de la siguiente forma:


Edité el archivo Rprofile.site agregando las siguientes líneas:


options(download.file.method = "libcurl")
Sys.setenv("http_proxy"="http://mi_proxy::mi_puerto;)
Sys.setenv("https_proxy"="http:// http://mi_proxy::mi_puerto;)
Sys.setenv("ftp_proxy"="http:// http://mi_proxy::mi_puerto;)



Sienddo mi_proxy y mi_puerto el proxy y puerto que tenemos habilitado.


Si al inicio de una sesión ejecutaba las líneas anteriores solo funcionaban
para esa sesión y a la siguiente las tenía que correr de vuelta.


Saludos,


Sebastián.



Enviado desde Correo  para
Windows



*De: *Carlos Ortega 
*Enviado: *jueves, 4 de mayo de 2023 9:04
*Para: *Sebastián Kruk Gencarelli 
*CC: *r-help-es@r-project.org
*Asunto: *Re: [R-es] Error al actualizar R 4.3.0



Hola,



Sí, esos errores son los típicos cuando no tienes permiso para salir por el
proxy...

Te hace falta permisos de administrador.



Gracias,

Carlos Ortega

www.qualityexcellence.es



El jue, 4 may 2023 a las 13:46, Sebastián Kruk Gencarelli (<
residuo.so...@gmail.com>) escribió:

Hola usuarios-R.



El lunes pasado en mi máquina Windows 10 el R 4.2.3 a 4.3.0.



Una vez instalado dejó de funcionar la actualización.



Me aparece lo siguiente:



>update.packages()

Warning: unable to access index for repository
https://cloud.r-project.org/src/contrib:

  no fue posible abrir la URL '
https://cloud.r-project.org/src/contrib/PACKAGES'



Es un equipo en el trabajo y estoy bajo un proxy. No soy administrador.



No me funcionó cambiar el proxy usando Sys.setenv pero si si hago
update.packages(method = "wininet") con los consiguientes warnings.



¿Hay alguna forma de solucionarlo yo sin privilegios de administrador o
preciso de un administrador?



Saludos y gracias de antemano,



Sebastián.



___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es



-- 

Saludos,
Carlos Ortega
www.qualityexcellence.es

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es