Re: [R] Beginner problem - using mod function to print odd numbers

2021-06-04 Thread Eric Berger
Typo num <- num + i should be num <- num + 1 On Sat, Jun 5, 2021 at 9:38 AM Hasan Diwan wrote: > unlist(sapply(seq(1,100), function(n) { if(n %% 2) n })) yields: > > [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 > [26] 51 53 55 57 59 61 63 65 67 69 71 73 75 7

Re: [R] Can I use group_map to iteratively process a dataframe?

2021-06-04 Thread Greg Minshall
Madison, by the way, it's sort of hard to follow your example. there's some concept of MWE ==? Minimum Working Example. duckduckgo, or others on the list, can probably point the way. and, by the way :), i'm no expert. in particular, not on magrittr pipes, or on group_*, though i use both in so

Re: [R] Beginner problem - using mod function to print odd numbers

2021-06-04 Thread Hasan Diwan
unlist(sapply(seq(1,100), function(n) { if(n %% 2) n })) yields: [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 [26] 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 As for why your solution isn't working, if you'd like me to take a close

[R] Beginner problem - using mod function to print odd numbers

2021-06-04 Thread nelpar
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] 45 [1] 55 [1] 91 [1] 105 [1] 153 [1] 171 [1] 231 [1] 253 [1] 325 [1] 351 [1] 435 [1] 465 [1] 561 [1] 595 [

[R] Conversion of String to Datetime: How to Keep Timezone Offset when Printing?

2021-06-04 Thread Thomas Bulka
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, DT2) What I want to do now, is to covert

[R] Can I use group_map to iteratively process a dataframe?

2021-06-04 Thread Madison Bell
I want to iteratively process a master list of comparisons using group_walk() as an alternative method to import batches of .csv files. I have the code for iteratively importing batch csvs here: #Import list of csv files from directory, formatted as: |rownm | neg | pos | |--|-|-| |neg

Re: [R] shinyFiles update shinySaveButton filename varaible from server

2021-06-04 Thread Bert Gunter
Note, per the Posting Guide (linked below), "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R ), ask questions on R-help. If the question relates to a *contributed package* ,

Re: [R] foreign package read.spss() and NA levels

2021-06-04 Thread Uwe Ligges
On 27.05.2021 12:27, Allen, Justin wrote: Hi All, Wanted to report what may be a bug or possibly an oversight, but I am unsure, in the "foreign" packages in the read.spss() command, https://cran.r-project.org/web/packages/foreign/index.html. When running the following code, input <- read.