Re: [R] TWITTER API environment variables

2020-04-07 Thread K. Elo
Hi! Have you already read this: https://cran.r-project.org/web/packages/rtweet/vignettes/auth.html I think they explain rather well how to use Twitter tokens with rtweet... HTH, Kimmo ke, 2020-04-08 kello 17:19 +1200, Patrick Connolly kirjoitti: > I'm using the rtweet package which makes use

[R] TWITTER API environment variables

2020-04-07 Thread Patrick Connolly
I'm using the rtweet package which makes use of the Twitter API which requires a token alluded to by an environment variable. That environment variable is automatically set up from the Twitter web site and takes the name TWITTER_ (where is the name of the user in block letters). That worked

Re: [R] to create a new variable based on values in other variables

2020-04-07 Thread Yuan Chun Ding
Hi Bert, your code worked perfect. you always make me learn new R code skills! Thank you so much!! Ding From: Bert Gunter [bgunter.4...@gmail.com] Sent: Tuesday, April 7, 2020 12:53 PM To: Yuan Chun Ding Cc: r-help mailing list Subject: Re: [R] to

Re: [R] Question about nlminb function

2020-04-07 Thread Lim, Hwanggyu
Hello John, Thank you so much for your valuable response. I think using several new optimization function (e.g., Rvmmin) would be a good option for me. I will dive into those function. Thank you again! Best, Hwanggyu -Original Message- From: J C Nash Sent: Friday, April 3, 2020 9:49

Re: [R] Question about nlminb function

2020-04-07 Thread Lim, Hwanggyu
Hello Ivan, Thank you so much for your valuable comments. I will definitely look at the R package of nloptr you introduced. Best, Hwanggyu -Original Message- From: Ivan Krylov Sent: Friday, April 3, 2020 5:25 AM To: Lim, Hwanggyu Cc: r-help@r-project.org Subject: Re: [R] Question

Re: [R] to create a new variable based on values in other variables

2020-04-07 Thread Bert Gunter
You can use subscripting to generalize and avoid multiply nested ifelse's which, I agree, can be a nightmare. However, you have to be very careful about the logic of the conditions you create and the order in which you apply them. It is very easy to wipe out an earlier relationship with a later

Re: [R] to create a new variable based on values in other variables

2020-04-07 Thread Yuan Chun Ding
Hi Thierry, the values in the example data frame are fake numbers, my original data frame has hundreds of row and values are in wide range, not min or max of two variables, also the number 23 is also different in different data frames. I agree I need to use vectorized ifelse, but I got

Re: [R] to create a new variable based on values in other variables

2020-04-07 Thread Thierry Onkelinx via R-help
Dear Ding, It seems that you are looking for the ifelse() function. Clear use of pmax() and pmin() reduces the number of if statements. m1 <- c(12, 23, 22, 23) m2 <- c(23, 23, 3, 5) Ravg <- ifelse( pmax(m1, m2) == 23, pmin(m1, m2), (m1 + m2) / 2 ) Best regards, ir. Thierry Onkelinx

[R] to create a new variable based on values in other variables

2020-04-07 Thread Yuan Chun Ding
Hi R users, I want to create a new variable, Ravg, in data frame tem2 based on values of two other variables m1 and m2. the condition: if m1 = 23 and m2 =23 then Ravg =23; else if m1 != 23 and m2=23 then Ravg =m1; else if m1 =23 and m2 !=23 then Ravg=m2; else Ravg=average of m1 and m2; the

Re: [R] Help needed: gdal-configuration to install sf package in Mac OS Catalina

2020-04-07 Thread David Winsemius
On 4/5/20 9:27 PM, Bijesh Mishra wrote: Hi, I am using R in Mac. I was trying to install sf package but could not and got error. Detail message of error is under this email. It seems like I have to run gdal- configuration, but not sure what that means. Do you have any idea about that? GDAL

Re: [R] Basic XML function not working

2020-04-07 Thread Rasmus Liland
On 2020-04-07 14:23 +, Hoffman, Gabriel wrote: | I am having an issue with the XML package | failing on a basic function. This makes | packages that depend on this function also | fail: Hi! So XML::newXMLNode("bob") only works on the R 3.5.1, or r77979 as well? So the question might be

[R] Error using R caret package (train) with C5.0 decision tree to do K-fold cross validation

2020-04-07 Thread J4T5U8 via R-help
I'm trying to use the caret package to do repeated k-fold cross validation with C5.0 decision trees. The following code generates a working C5.0 decision tree (68% accuracy on confusion matrix): > model <- C5.0(as.factor(OneGM) ~., data=OneT.train) > results <- predict(object=model,

[R] Fwd: Sensitivity+Uncertainty Analysis//Evaporation//Markdown

2020-04-07 Thread Stefi Killing
Dear helpers, my script for my* Sensitivity + Uncertainty Analysis* concerning *evaporation processes *with the *Matt Shuttleworth-Equation* is not knitting to *markdown *completely. There are some problems with the figures I guess. May somebody help me? I would be very very grateful! Yours,

[R] Basic XML function not working

2020-04-07 Thread Hoffman, Gabriel
I am having an issue with the XML package failing on a basic function. This makes packages that depend on this function also fail: > library(XML) > newXMLNode("bob") I/O error : flush error I can’t find any reference to the error online > sessionInfo() R version 3.6.0 (2019-04-26) Platform:

Re: [R] MAP HELP

2020-04-07 Thread Jim Lemon
Hi Anjaly, I think that replacing the "geom_point" argument with "geom_text" will do what you want. Unfortunately I can't get an example to work (as usual) so I'm copying this back the the R help list in the hope that someone will provide the answer for you. Jim On Tue, Apr 7, 2020 at 7:29 PM

Re: [R] ncol() vs. length() on data.frames

2020-04-07 Thread Ivan Calandra
Dear Hervé, This is indeed a wise recommendation; I hadn't thought about colnames() vs. names(), and in general 2D vs. list notations. I will have to edit a bit more than I thought. Thank you all for all these hints! Best, Ivan -- Dr. Ivan Calandra TraCEr, laboratory for Traceology and