If you walk into the produce section of a grocery store and start asking people
how to fix your car, you may find a mechanic there because mechanics need
vegetables also, but that doesn't make that the right approach. Lots of people
here use the R language without touching RStudio... this mailin
I have R studio 1.4.11 06 installed on my Windows 10 PC along with R 4.1.0.
When I try to knit a project the RStudio does not do anything, and it does
not give an error message either. Every time I click knit button, it takes
me to the "R Markdown" tab at the bottom and then displays the full p
Hello,
You are absolutely right, I had misread the SO post date. Apologies for
my mistake. Besides, I even forgot the SO link [1] :(.
Now, for the question.
1. The code is giving errors, that it can't find functions
gwet.ac1.table
kappa2.table
and I have removed the calls to them and the c
I'm sorry, but this is a good example of how one should *not* do this in
R. I also should apologize for any pedantry that follows, but I believe
this serves as a nice example of the ideas.
Two of R's central features as a "data science" language are that many of
its core capabilities are "vectori
> i <- 1L; span <- 1:100; result <- NA;
> for (i in span){
+ ifelse(i %% 2 != 0, result[i] <- TRUE, result[i] <- FALSE)
+ }
> span[result]
[1] 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43
45 47 49 51 53 55 57
[30] 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99
This question had been posted on SO for a week with no response. I reached out
to rhelp two days ago. I deleted the original question on SO and reposted an
abbreviated version this morning.
Sorry for the cross posting, but I am urgently trying to get some ideas on how
approach this problem.
Hello,
This is cross-posted from StackOverflow [1]. Cross posting is not well
seen on R-help and the SO post is better explained (at least the data
seem to be more complete). You should have waited for an answer there.
Hope this helps,
Rui Barradas
Às 15:03 de 04/06/21, Madison Bell escrev
Hello,
Why not write a function?
odd <- function(x, numeric = TRUE){
i <- x %% 2 == 1
if(numeric) x[i] else i
}
odd(1:100)
Hope this helps,
Rui Barradas
Às 19:17 de 02/06/21, nelpar escreveu:
I don't understand. --
7%%2=1
9%%2=1
11%%2=1
What aren't these numbers printing ?
num<-0
On 6/4/21 9:20 PM, Thomas Bulka wrote:
Hello list,
I do have a hard time handling date and time data with different
timezone offsets. Say, I have two strings which represent different
dates/times, like so:
DT1 <- "2021-06-19T13:45:00-03:00"
DT2 <- "2020-07-20T11:39:12+02:00"
my_dates <- c(DT1
No. Sorry. A POSIXct vector can have only one timezone. Kind of goes along with
the whole vectorization thing.
You could fake it with lists, but they are dramatically less convenient. I
suppose you could also fake it by developing your own variation on the POSIXct
class... but that would be rat
>
> I don't understand. --
>
> 7%%2=1
> 9%%2=1
> 11%%2=1
>
> What aren't these numbers printing ?
>
> num<-0
> for (i in 1:100){
> num<-num+i
> if (num%%2 != 0)
> print(num)
> }
Your code tests the numbers
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, …
and correctly prints the odd o
What if you used
num <- num + 1
?
On June 2, 2021 11:17:50 AM PDT, nelpar wrote:
>
>I don't understand. --
>
>7%%2=1
>9%%2=1
>11%%2=1
>
>What aren't these numbers printing ?
>
>
>num<-0
>for (i in 1:100){
> num<-num+i
>if (num%%2 != 0)
> print(num)
>}
>
>
>[1] 1
>[1] 3
>[1] 15
>[1] 21
>[1]
12 matches
Mail list logo