Re: [R] data frame returned from sapply but vector expected

2022-11-04 Thread PIKAL Petr
2022 1:37 PM > To: PIKAL Petr > Cc: R-help Mailing List > Subject: Re: [R] data frame returned from sapply but vector expected > > On Fri, 4 Nov 2022 15:30:27 +0300 > Ivan Krylov wrote: > > > sapply(mylist2, `[[`, 'b') > > Wait, that would simplify t

Re: [R] data frame returned from sapply but vector expected

2022-11-04 Thread Ivan Krylov
On Fri, 4 Nov 2022 15:30:27 +0300 Ivan Krylov wrote: > sapply(mylist2, `[[`, 'b') Wait, that would simplify the return value into a matrix when there are no NULLs. But lapply(mylist2, `[[`, 'b') should work in both cases, which in my opinion goes to show the dangers of using simplifying function

Re: [R] data frame returned from sapply but vector expected

2022-11-04 Thread Ivan Krylov
On Fri, 4 Nov 2022 12:19:09 + PIKAL Petr wrote: > > str(sapply(mylist2, "[", "b")) > > List of 3 > > $ : NULL > > $ :'data.frame': 5 obs. of 1 variable: > > ..$ b: num [1:5] 0.01733 0.46055 0.19421 0.11609 0.00789 > > $ :'data.frame': 5 obs. of 1 variable: > > ..$ b:

Re: [R] data manipulation question

2021-08-23 Thread Jim Lemon
Hi Kai, How about setting: germlinepatients$DisclosureStatus <- NA then having your three conditional statements as indices: germlinepatients$DisclosureStatus[germlinepatients$gl_resultsdisclosed == 1] <-"DISCLOSED" germlinepatients$DisclosureStatus[germlinepatients$ gl_resultsdisclosed == 0] <-

Re: [R] Data is not properly written in csv file

2021-06-21 Thread David Winsemius
This was an exact duplicate of a posting to StackOverflow where it has a response. You are asked in the Posting Guide not to crosspost. -- David. On 6/20/21 8:03 AM, Sri Priya wrote: location <- ' http://keic.mica-apps.net/wwwisis/ET_Annual_Reports/Religare_Enterprises_Ltd/RELIGARE-2017-2018

Re: [R] Data is not properly written in csv file

2021-06-21 Thread Marc Schwartz via R-help
Hi, If each of the extracted tables do not have consistent content and structure, that may be causing problems as you append each to the same file. You might want to modify your loop so that each table gets written to a different CSV file and see what that looks like. Also, review ?write.ta

Re: [R] Data is not properly written in csv file

2021-06-21 Thread Bert Gunter
Please read the posting guide, linked below, which says: "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 *contribute

Re: [R] Data transformation problem

2020-11-12 Thread phil
Thank you so much for this elegant solution, Jeff. Philip On 2020-11-12 02:20, Jeff Newmiller wrote: I am not a data.table afficiando, but here is how I would do it with dplyr/tidyr: library(dplyr) library(tidyr) do_per_REL <- function( DF ) { rng <- range( DF$REF1 ) # watch out for missing

Re: [R] Data transformation problem

2020-11-11 Thread Jeff Newmiller
I am not a data.table afficiando, but here is how I would do it with dplyr/tidyr: library(dplyr) library(tidyr) do_per_REL <- function( DF ) { rng <- range( DF$REF1 ) # watch out for missing months? DF <- ( data.frame( REF1 = seq( rng[ 1 ], rng[ 2 ], by = "month" ) ) %>% left_join

Re: [R] Data Table not rendering properly using R shiny

2020-11-07 Thread Rui Barradas
Hello, Or maybe logical_idx <- max_usage_hours_per_region$Region %in% input$Region Another option is ?match Hope this helps, Rui Barradas Às 15:41 de 07/11/20, Jeff Newmiller escreveu: This looks odd... max_usage_hours_per_region[input$Region,] This would only work if you had rownames

Re: [R] Data Table not rendering properly using R shiny

2020-11-07 Thread Jeff Newmiller
This looks odd... max_usage_hours_per_region[input$Region,] This would only work if you had rownames on that data frame corresponding to the names of the Regions. This is a common R mistake... you probably need logical_idx <- max_usage_hours_per_region$Region == input$Region max_usage_hours_per

Re: [R] Data Table not rendering properly using R shiny

2020-11-07 Thread Marc Schwartz via R-help
Hi, Please drop R-Devel as a cc: from this thread for further replies. This topic is definitely not relevant there and cross-posting is not needed, but does require manual moderation. Thanks, Marc Schwartz > On Nov 7, 2020, at 10:23 AM, Bert Gunter wrote: > > Better to post on RStudio sup

Re: [R] Data Table not rendering properly using R shiny

2020-11-07 Thread Bert Gunter
Better to post on RStudio support, I think. Shiny is an RStudio package and product and this list if for R language/programming help. The two are separate. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breat

Re: [R] data error problem

2020-10-05 Thread Jim Lemon
Hi Mir, Without knowing what the data looks like, this is only a guess. read.table() expects a white space delimiter and if you have a space in one of your column names it will consider it as two names instead of one. How many columns do you expect? Jim On Mon, Oct 5, 2020 at 6:14 PM Mohammad Tan

Re: [R] data error problem

2020-10-05 Thread Mohammad Tanvir Ahamed via R-help
Hi, In your data file, the first row does not have an equal number of column like the rest of the row.Check your data file. Specially 1st row.   Regards.Tanvir AhamedStockholm, Sweden | mashra...@yahoo.com On Monday, 5 October 2020, 08:11:48 am GMT+2, Mir Md. Abdus Sal

Re: [R] Data With Ordinal Responses: Calculate ICC & Assessing Model Fit

2020-08-17 Thread Bert Gunter
I believe you should post on r-sig-mixed-models, not here. You are more likely to find the interest and expertise you seek there. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" c

Re: [R] Data frames intersections

2020-04-22 Thread Jim Lemon
Hi Julie, Your task is a bit obscure and I don't have the function "st_intersects", but I'll suggest this: br_list<-list() # your commands would have only run once for (i in 1:nrow(arrets_buffer)) { br_list[[i]]<- st_intersects(x = batiments, arrets_buffer[i,], sparse = FALSE) } You should get

Re: [R] Data Carpentry - Creating a New SQLite Database

2020-01-10 Thread William Michels via R-help
Hi Phillip, Skipping to the last few lines of your email, did you download a program to look at Sqlite databases (independent of R) as listed below? Maybe that program ("DB Browser for SQLite") and/or the instructions below can help you locate your database directory: https://datacarpentry.org/se

Re: [R] Data Carpentry - Creating a New SQLite Database

2020-01-10 Thread Bert Gunter
Please note that tidyverse packages have their own support resources at RStudio, whence they came; e.g. here: https://education.rstudio.com/learn/beginner/ You may also do better asking about issues that concern them at their support site: https://support.rstudio.com/hc/en-us though, as you alrea

Re: [R] Data Carpentry - Creating a New SQLite Database

2020-01-10 Thread Ivan Krylov
On Fri, 10 Jan 2020 11:31:58 -0700 "Phillip Heinrich" wrote: > below is the text from the tutorial. The black type is from the > tutorial. The green and blue is the suggested R code. My comments > are in red R-help is a plain text mailing list, so the markup has been stripped off (and since H

Re: [R] data reshape

2019-12-20 Thread Yuan Chun Ding
Cc: r-help@r-project.org Subject: Re: [R] data reshape [Attention: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails.] It is perhaps worth noting that

Re: [R] data reshape

2019-12-20 Thread Bert Gunter
; One my way to work place this morning, I changed my intension; I will not >> reshape to wide format and actually like the long format I generated. I >> will read in a VNTR marker annotation file including VNTRid in first column >> and marker locations in human chromosomes in the sec

Re: [R] data reshape

2019-12-20 Thread Bert Gunter
the 652 file I read in. > > > > Do you know a good way to merge all those 652 files (with two columns) ? > > > > Thank you, > > > > Ding > > > > > > #merge all 652 files into one file with VNTRid as first column, 2nd to > 653th column are genot

Re: [R] data reshape

2019-12-20 Thread Yuan Chun Ding
erge all 652 files into one file with VNTRid as first column, 2nd to 653th column are genotype with header #as sample ID, so From: Bert Gunter [mailto:bgunter.4...@gmail.com] Sent: Thursday, December 19, 2019 6:52 PM To: Yuan Chun Ding Cc: r-help@r-project.org Subject: Re: [R] data reshape __

Re: [R] data reshape

2019-12-19 Thread Bert Gunter
Did you even make an attempt to do this? -- or would you like us do all your work for you? If you made an attempt, show us your code and errors. If not, we usually expect you to try on your own first. If you have no idea where to start, perhaps you need to spend some more time with tutorials to le

Re: [R] Data Structure to Unnest_tokens in tidytext package

2019-12-11 Thread Eric Berger
Hi Sarah, I looked at the documentation that you linked to. It contains the step text_df <- tibble(line = 1:4, text = text) before it does the step text_df %>% unnest_tokens(word, text) So you may be missing a step. Best, Eric On Tue, Dec 10, 2019 at 9:05 PM Sarah Payne wrote: > > Hi--I'm

Re: [R] data load from excel files

2019-11-13 Thread Rui Barradas
Hello, Try which.max? Hope this helps, Rui Barradas Às 14:10 de 13/11/19, ani jaya escreveu: Thank you very much Mr. Rui, but for delete the duplicated row I use: ... library(tidyverse) alldata<-data.frame(Reduce(rbind, pon1)) c<-(which(duplicated(alldata$Tanggal))) #duplicate alldata<-allda

Re: [R] data load from excel files

2019-11-13 Thread ani jaya
Thank you very much Mr. Rui, but for delete the duplicated row I use: ... library(tidyverse) alldata<-data.frame(Reduce(rbind, pon1)) c<-(which(duplicated(alldata$Tanggal))) #duplicate alldata<-alldata[-c,] attach(alldata) because not every last row from every df is bad one. Another problem

Re: [R] data load from excel files

2019-11-13 Thread Rui Barradas
Hello, Maybe the following will get you close to what you want. # remove the last row from every df pon1 <- lapply(pon1, function(DF){ DF[[1]] <- as.Date(DF[["Tanggal"]], "%d-%m-%Y") DF[-nrow(DF), ] }) # order the list by year-month inx_ym <- sapply(pon1, function(DF){ format(DF[["Tangg

Re: [R] Data conversion

2019-09-18 Thread Jim Lemon
Hi Edward, Say your "data frame" is named "epdat". This may do it: epmat<-matrix(epdat[10:289],nrow=28) colnames(epmat)<-sub("1","",names(epdat[10:289])[seq(1,270,by=28)]) This one looks like the Sorceror's Apprentice tangled with one of those experimental schedule scripting programs. Jim On Th

Re: [R] Data frame organization

2019-08-27 Thread Arnaud Mosnier
Aaaah finally !!! Thanks a lot !!! Arnaud Le lun. 26 août 2019 18 h 28, Jim Lemon a écrit : > Hi Arnaud, > The reason I wrote the following function is that it always takes me > half a dozen tries with "reshape" before I get the syntax right: > > amdf<-read.table(text="A 10 > B 5 > C

Re: [R] Data frame organization

2019-08-26 Thread Jim Lemon
Hi Arnaud, The reason I wrote the following function is that it always takes me half a dozen tries with "reshape" before I get the syntax right: amdf<-read.table(text="A 10 B 5 C 9 A 5 B 15 C 20") library(prettyR) stretch_df(amdf,"V1","V2") V1 V2_1 V2_2 1 A 105 2 B5 15 3

Re: [R] Data frame organization

2019-08-26 Thread Sam Charya via R-help
Dear Arnaud, I just played around with your data a bit and found this to be useful. But kindly note that I am NO expert like the other people in the group. My answer to you is purely for help purposes. My knowledge in R too is limited. I used the reshape function and arrived at something. I am 

Re: [R] data frame solution

2019-03-20 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
Statements like c(rbind(x, xx+yy), max(t)) and rep(0,length(df$b[1])) don't make any sense. You're example will be easier to understand if you show us the nrow(df) ==3 case. Thanks Grant Izmirlian, Ph.D. Mathematical Statistician izmir...@mail.nih.gov Delivery Address: 9609 Medical Center Dr,

Re: [R] data transformation

2019-01-20 Thread Jeff Newmiller
There is no "perhaps" about it. Nonsense phrases like "similar to logit, where I dont [sic] lose normality of the data" that lead into off-topic discussions of why one introduces transformations in the first place are perfect examples of why questions like this belong on a statistical theory dis

Re: [R] data transformation

2019-01-20 Thread Richard M. Heiberger
this might work for you newy <- sign(oldy)*f(abs(oldy)) where f() is a monotonic transformation, perhaps a power function. On Sun, Jan 20, 2019 at 11:08 AM Adrian Johnson wrote: > > I apologize, I forgot to mention another key operation. > in my matrix -1 to <0 has a different meaning while va

Re: [R] data transformation

2019-01-20 Thread David L Carlson
.html and provide commented, minimal, self-contained -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Adrian Johnson Sent: Sunday, January 20, 2019 10:08 AM To: r-help Subject: Re: [R] data transformation I apologize, I forgot to mention another key

Re: [R] data transformation

2019-01-20 Thread Adrian Johnson
I apologize, I forgot to mention another key operation. in my matrix -1 to <0 has a different meaning while values between >0 to 1 has a different set of meaning. So If I do logit transformation some of the positives becomes negative (values < 0.5 etc.). In such case, the resulting transformed ma

Re: [R] data frame transformation

2019-01-07 Thread Andras Farkas via R-help
Thanks Bert this will do... Andras Sent from Yahoo Mail on Android On Sun, Jan 6, 2019 at 1:09 PM, Bert Gunter wrote: ... and my reordering of column indices was unnecessary:    merge(dat, d, all.y = TRUE)will do. Bert Gunter "The trouble with having an open mind is that people keep comi

Re: [R] data frame transformation

2019-01-06 Thread Bert Gunter
... and my reordering of column indices was unnecessary: merge(dat, d, all.y = TRUE) will do. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, Jan 6, 20

Re: [R] data frame transformation

2019-01-06 Thread Bert Gunter
Like this (using base R only)? dat<-data.frame(id=id,letter=letter,weight=weight) # using your data ud <- unique(dat$id) ul = unique(dat$letter) d <- with(dat, data.frame( letter = rep(ul, e = length(ud)), id = rep(ud, length(ul)) ) ) merge(dat[,c(2,1,3)]

Re: [R] data frame transformation

2019-01-06 Thread K. Elo
Hi! Maybe this would do the trick: --- snip --- library(reshape2) # Use 'reshape2' library(dplyr)# Use 'dplyr' datatransfer<-data %>% mutate(letter2=letter) %>% dcast(id+letter~letter2, value.var="weight") --- snip --- Or did I misunderstood something? Best, Kimmo 2019-01-06, 13:16

Re: [R] Data frame with Factor column missing data change to NA

2018-06-14 Thread Bill Poling
859932257 Remove Good to go now, for the moment, big smile! Thank you for your help Sir. WHP From: Bill Poling Sent: Thursday, June 14, 2018 6:49 AM To: 'Jim Lemon' Cc: r-help (r-help@r-project.org) Subject: RE: [R] Data frame with Factor column missing data change to NA #Good

Re: [R] Data frame with Factor column missing data change to NA

2018-06-14 Thread Bill Poling
HX recommended savings Claim paid without PHX recommended savings MRC Amount MRC Amount Appreciate your help Sir. WHP From: Jim Lemon [mailto:drjimle...@gmail.com] Sent: Wednesday, June 13, 2018 8:30 PM To: Bill Poling Cc: r-help (r-help@r-project.org) Subject: Re: [R] Data frame with Fa

Re: [R] Data frame with Factor column missing data change to NA

2018-06-13 Thread Jim Lemon
Hi Bill, It may be that the NonAcceptanceOther, being a character value, has "" (0 length string) rather than NA. You can convert that to NA like this: df2$NonAcceptanceOther[nchar(df2$NonAcceptanceOther) == 0]<-NA Jim On Thu, Jun 14, 2018 at 12:47 AM, Bill Poling wrote: > Good morning. > > #I

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread Ding, Yuan Chun
insem...@comcast.net] Sent: Monday, March 05, 2018 3:55 PM To: Bert Gunter Cc: Ding, Yuan Chun; r-help@r-project.org Subject: Re: [R] data analysis for partial two-by-two factorial design > On Mar 5, 2018, at 3:04 PM, Bert Gunter wrote: > > But of course the whole point of additivity is to

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread David Winsemius
erated from a partial two-by-two factorial > > > design: two levels for drug A (yes, no), two levels for drug B (yes, no); > > > however, data points are available only for three groups, no drugA/no > > > drugB, yes drugA/n

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread Bert Gunter
generated from a partial two-by-two factorial > design: two levels for drug A (yes, no), two levels for drug B (yes, no); > however, data points are available only for three groups, no drugA/no > drugB, yes drugA/no drugB, yes drugA/yes drug B, omitting the fourth group > of no drugA/yes dr

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread Bert Gunter
ning > three separate T tests? > > > > > > Thank you so much!! > > > > > > Ding > > > > > > I need to analyze data generated from a partial two-by-two factorial > design: two levels for drug A (yes, no), two levels for drug B (yes, no); >

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread David Winsemius
o levels for drug A (yes, no), two levels for drug B (yes, no); > > however, data points are available only for three groups, no drugA/no > > drugB, yes drugA/no drugB, yes drugA/yes drug B, omitting the fourth group > > of no drugA/yes drugB. I think we can not investigate interacti

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread Ding, Yuan Chun
-help-boun...@r-project.org] On Behalf Of Ding, Yuan Chun Sent: Monday, March 05, 2018 2:45 PM To: Bert Gunter; David Winsemius Cc: r-help@r-project.org Subject: Re: [R] data analysis for partial two-by-two factorial design Hi Bert and David, Thank you so much for willingness to spend some time on

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread Ding, Yuan Chun
, March 05, 2018 2:27 PM To: David Winsemius Cc: Ding, Yuan Chun; r-help@r-project.org Subject: Re: [R] data analysis for partial two-by-two factorial design David: I believe your response on SO is incorrect. This is a standard OFAT (one factor at a time) design, so that assuming additivity (no

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread Bert Gunter
> Replied on CrossValidated where this would be on-topic. > > -- > David, > > > > > > > From: Bert Gunter [mailto:bgunter.4...@gmail.com] > > Sent: Friday, March 02, 2018 12:32 PM > > To: Ding, Yuan Chun > > Cc: r-help@

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread David Winsemius
, > > > From: Bert Gunter [mailto:bgunter.4...@gmail.com] > Sent: Friday, March 02, 2018 12:32 PM > To: Ding, Yuan Chun > Cc: r-help@r-project.org > Subject: Re: [R] data analysis for partial two-by-two factorial design > > > [Atte

Re: [R] data analysis for partial two-by-two factorial design

2018-03-05 Thread Ding, Yuan Chun
= drug A + drug B? any suggestion is appreciated. From: Bert Gunter [mailto:bgunter.4...@gmail.com] Sent: Friday, March 02, 2018 12:32 PM To: Ding, Yuan Chun Cc: r-help@r-project.org Subject: Re: [R] data analysis for partial two-by-two factorial design [Attention

Re: [R] data analysis for partial two-by-two factorial design

2018-03-02 Thread Ding, Yuan Chun
Hi Bert, Thank you so much for your direction, I have asked a question on stackexchange website. Ding From: Bert Gunter [mailto:bgunter.4...@gmail.com] Sent: Friday, March 02, 2018 12:32 PM To: Ding, Yuan Chun Cc: r-help@r-project.org Subject: Re: [R] data analysis for partial two-by-two

Re: [R] data analysis for partial two-by-two factorial design

2018-03-02 Thread Bert Gunter
This list provides help on R programming (see the posting guide linked below for details on what is/is not considered on topic), and generally avoids discussion of purely statistical issues, which is what your query appears to be. The simple answer is yes, you can fit the model as described, but y

Re: [R] data analysis for partial two-by-two factorial design

2018-03-02 Thread Ding, Yuan Chun
Dear R users, I need to analyze data generated from a partial two-by-two factorial design: two levels for drug A (yes, no), two levels for drug B (yes, no); however, data points are available only for three groups, no drugA/no drugB, yes drugA/no drugB, yes drugA/yes drug B, omitting the fourt

Re: [R] Data Table Merge Help

2018-02-01 Thread Jeff Newmiller
I rarely use data.table, but I think the vignette for the package discusses rolling joins. Also, Google popped up [1]. [1] https://www.r-bloggers.com/understanding-data-table-rolling-joins/ -- Sent from my phone. Please excuse my brevity. On February 1, 2018 9:45:53 AM PST, "Graeve, Nick" wr

Re: [R] Data Table Merge Help

2018-02-01 Thread Bert Gunter
Did you search first? (This is suggested by the posting guide -- below -- prior to posting). "merge 2 data.tables in R" brought up what looked like useful stuff, in particular the merge() function for data tables. If this does not do what you want, it may help to explain why not. Alternatively,

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-12-11 Thread Robert Wilkins
Dominik (and others) If it is indeed still the biggest paint point, even in 2017, then maybe we can do something about that, with more efforts at different user interface design and try-outs with them on specialized datasets. [ The fact that in some specialties, such as clinical trials, for exampl

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-30 Thread Dominik Schneider
I would agree that getting data into R from various sources is the biggest pain point. Even if there is an api, the results are not always consistent and you have to do lots of dimension checking to get it right. Or there isn't an open api at all and you have to hack it by web scraping or otherwise

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-29 Thread Jim Lemon
Hi again, Typo in the last email. Should read "about 40 standard deviations". Jim On Thu, Nov 30, 2017 at 10:54 AM, Jim Lemon wrote: > Hi Robert, > People want different levels of automation in the software they use. > What concerns many of us is the desire for the function > "figure-out-what-th

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-29 Thread Jim Lemon
Hi Robert, People want different levels of automation in the software they use. What concerns many of us is the desire for the function "figure-out-what-this-data-is-import-it-and-get-rid-of-bad-values". Such users typically want something that justifies its use by being written by someone who seem

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-29 Thread Robert Wilkins
Christopher, OK, well what about a range of functions in an R package that automatically, with very little syntax, pulls in data from a variety of formats (CSV, SQLite, and so on) and converts them to an R data frame. You seem to be pointing to something like that. Something like that, in some for

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-29 Thread Bert Gunter
Oh Crap! I mistakenly replied onlist. PLEASE IGNORE -- these are only my ignorant opinions. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Nov 29,

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-29 Thread Christopher W. Ryan
Great question. What do I want? I want my co-workers to stop using Excel spreadsheets for data entry, storage, and sharing! I want them to understand the value of data discipline. But alas . . . . I work in a county health department in the US. Between dplyr, stringr, grep, grepl, and the base R r

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-29 Thread Bert Gunter
I don't think my view is of interest to many, so offlist. I reject this: " I would consider data analysis work to be three stages: data preparation, statistical analysis, and producing the report." For example, there is no such thing as "outliers" -- data to be removed as part of cleaning/prepar

Re: [R] Data invisible to read.csv

2017-11-01 Thread Jeff Newmiller
You are using terms and concepts that apply to spreadsheets, but do not apply to R or CSV files. Please conform to the Posting Guide and make a reproducible example [1][2][3] using R code to demonstrate your problem. I suspect you will find that your problem begins in your spreadsheet and not in

Re: [R] Data arrangement for PLSDA using the ropls package

2017-09-18 Thread Bert Gunter
If this is a bioconductor package, why do you not post on the bioconductor list? -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Sep 18, 2017 at

Re: [R] data frame question

2017-08-06 Thread Andras Farkas via R-help
thank you both... assumption is in fact that a and b are always the same length... these work for me well... much appreciate it... Andras On Sunday, August 6, 2017 12:14 PM, Ulrik Stervbo wrote: Hi Andreas, assuming that the increment is always indicated by the same value (in your exam

Re: [R] data frame question

2017-08-06 Thread Ulrik Stervbo
Hi Andreas, assuming that the increment is always indicated by the same value (in your example 0), this could work: df$a <- cumsum(seq_along(df$b) %in% which(df$b == 0)) df HTH, Ulrik On Sun, 6 Aug 2017 at 18:06 Bert Gunter wrote: > Your specification is a bit unclear to me, so I'm not sure t

Re: [R] data frame question

2017-08-06 Thread Bert Gunter
Your specification is a bit unclear to me, so I'm not sure the below is really what you want. For example, your example seems to imply that a and b must be of the same length, but I do not see that your description requires this. So the following may not be what you want exactly, but one way to do

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread William Dunlap via R-help
Re-importing the data with read.table's strip.white=TRUE argument may be an easier way to deal with the problem (if the problem is leading or trailing whitespace). Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Jun 1, 2017 at 9:17 AM, David Winsemius wrote: > > > On Jun 1, 2017, at 8:57 A

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread Charles C. Berry
On Thu, 1 Jun 2017, Rui Barradas wrote: Hello, In order for us to help we need to know how you've imported your data. What was the file type? What instructions have you used to import it? Did you use base R or a package? Give us a minimal but complete code example that can reproduce your sit

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread David Winsemius
> On Jun 1, 2017, at 8:57 AM, William Dunlap via R-help > wrote: > > Check for leading or trailing spaces in the strings in your data. > dput(dataset) would show them. This function would strip any leading or trailing spaces from a column: trim <- function (s) { s <- as.charac

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread David L Carlson
: Thursday, June 1, 2017 11:07 AM To: Ulrik Stervbo ; Rui Barradas ; Tara Adcock ; r-help@r-project.org Cc: William Dunlap via R-help Subject: Re: [R] Data import R: some explanatory variables not showing up correctly in summary It looks like your printouts are based on the R summary() function

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread David L Carlson
[mailto:r-help-boun...@r-project.org] On Behalf Of Ulrik Stervbo Sent: Thursday, June 1, 2017 10:50 AM To: Rui Barradas ; Tara Adcock ; r-help@r-project.org Subject: Re: [R] Data import R: some explanatory variables not showing up correctly in summary Hi Tara, It seems that you categorise and

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread William Dunlap via R-help
Check for leading or trailing spaces in the strings in your data. dput(dataset) would show them. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Jun 1, 2017 at 8:49 AM, Ulrik Stervbo wrote: > Hi Tara, > > It seems that you categorise and count for each category. Could it be that > the met

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread Ulrik Stervbo
Hi Tara, It seems that you categorise and count for each category. Could it be that the method you use puts everything that doesn't match the predefined categories in Other? I'm only guessing because without a minimal reproducible example it's difficult to do anything else. Best wishes Ulrik R

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread Rui Barradas
Hello, In order for us to help we need to know how you've imported your data. What was the file type? What instructions have you used to import it? Did you use base R or a package? Give us a minimal but complete code example that can reproduce your situation. Hope this helps, Rui Barradas

Re: [R] Data and Variables from Tables

2017-03-22 Thread Shawn Way
-project.org; Shawn Way ; Enrico Schumann Cc: r-help@r-project.org Subject: Re: [R] Data and Variables from Tables He offered two solutions, and I want to second the vote against the first one. I often put large numbers of configuration variables in a few CSV files organized by topic area and

Re: [R] Data and Variables from Tables

2017-03-21 Thread Jeff Newmiller
and their >documentation significantly easier. > >Thank you > >Shawn Way, PE > >-Original Message- >From: Enrico Schumann [mailto:e...@enricoschumann.net] >Sent: Tuesday, March 21, 2017 4:40 PM >To: Shawn Way >Cc: r-help@r-project.org >Subject: Re: [R] Dat

Re: [R] Data and Variables from Tables

2017-03-21 Thread Shawn Way
-help@r-project.org Subject: Re: [R] Data and Variables from Tables On Tue, 21 Mar 2017, Shawn Way writes: > I have an org-mode table with the following structure that I am > pulling into an R data.frame, using the sfsmisc package and using > xtable to print in org-mode > > |

Re: [R] Data and Variables from Tables

2017-03-21 Thread Enrico Schumann
On Tue, 21 Mar 2017, Shawn Way writes: > I have an org-mode table with the following structure > that I am pulling into an R data.frame, using the > sfsmisc package and using xtable to print in org-mode > > | Symbol | Value | Units | > |--+---+---| > | A

Re: [R] data manipulation

2016-12-19 Thread Duncan Mackay
"data.frame", row.names = c(NA, -396L )) Regards Duncan -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Monday, 19 December 2016 13:47 To: Duncan Mackay Cc: R Subject: Re: [R] data manipulation > On Dec 18, 2016, at 5:39 PM, Duncan Mackay wrote

Re: [R] data manipulation

2016-12-18 Thread David Winsemius
Cowpertwait. -- David. > >> >> -- >> David. >>> >>> If it does not get through will do a dput as the file is only 7K >>> >>> Regards >>> >>> Duncan >>> Duncan Mackay >>> Department of Agronomy and

Re: [R] data manipulation

2016-12-18 Thread David Winsemius
> From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Monday, 19 December 2016 05:36 > To: Duncan Mackay > Cc: R > Subject: Re: [R] data manipulation > > >> On Dec 17, 2016, at 7:57 PM, Duncan Mackay wrote: >> >> Hi >> >> Coming late t

Re: [R] data manipulation

2016-12-18 Thread Duncan Mackay
Hi David Thanks for the info. As a test I am attaching it anyway Regards Duncan -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Monday, 19 December 2016 05:36 To: Duncan Mackay Cc: R Subject: Re: [R] data manipulation > On Dec 17, 2016, at 7:57

Re: [R] data manipulation

2016-12-18 Thread peter dalgaard
gt; Email: home: mac...@northnet.com.au >> >> -Original Message- >> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rui Barradas >> Sent: Thursday, 15 December 2016 01:19 >> To: Farshad Fathian; r-help >> Subject: Re: [R] data manipulatio

Re: [R] data manipulation

2016-12-18 Thread David Winsemius
- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rui Barradas > Sent: Thursday, 15 December 2016 01:19 > To: Farshad Fathian; r-help > Subject: Re: [R] data manipulation > > Hello, > > Please cc your mails to the list. > As for your data, your u

Re: [R] data manipulation

2016-12-18 Thread David Winsemius
ui Barradas > Sent: Thursday, 15 December 2016 01:19 > To: Farshad Fathian; r-help > Subject: Re: [R] data manipulation > > Hello, > > Please cc your mails to the list. > As for your data, your url is wrong, you need to contact Massey or maybe > the source of your info

Re: [R] data manipulation

2016-12-17 Thread Duncan Mackay
nt of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rui Barradas Sent: Thursday, 15 December 2016 01:19 To: Farshad Fathian; r-help Subject: Re: [R]

Re: [R] data manipulation

2016-12-15 Thread John Kane via R-help
That should read "now" instead of "not" On Thursday, December 15, 2016 6:49 PM, John Kane wrote: It downloaded a file for me earlier but I am not getting the 404 error and I did not bother to save the download.  Shrug. On Wednesday, December 14, 2016 6:57 AM, John Kane via R-he

Re: [R] data manipulation

2016-12-15 Thread John Kane via R-help
It downloaded a file for me earlier but I am not getting the 404 error and I did not bother to save the download.  Shrug. On Wednesday, December 14, 2016 6:57 AM, John Kane via R-help wrote: xx <- read.csv("http://massey.ac.nz/~pscoperwait/ts/cbe.dat";) gives me something. Since we ha

Re: [R] data manipulation

2016-12-14 Thread Rui Barradas
half Of Rui Barradas Sent: Wednesday, December 14, 2016 6:12 AM To: John Kane; Farshad Fathian; r-h...@stat.math.ethz.ch Subject: Re: [R] data manipulation Hello, What do you mean by "gives me something"? xx <- read.csv("http://massey.ac.nz/~pscoperwait/ts/cbe.dat";) Error in

Re: [R] data manipulation

2016-12-14 Thread David Winsemius
352 > > > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rui Barradas > Sent: Wednesday, December 14, 2016 6:12 AM > To: John Kane; Farshad Fathian; r-h...@stat.math.ethz.ch > Subject: Re: [R] data manipulation > > Hell

Re: [R] data manipulation

2016-12-14 Thread David L Carlson
r-h...@stat.math.ethz.ch Subject: Re: [R] data manipulation Hello, What do you mean by "gives me something"? xx <- read.csv("http://massey.ac.nz/~pscoperwait/ts/cbe.dat";) Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(f

Re: [R] data manipulation

2016-12-14 Thread Rui Barradas
Hello, Please cc your mails to the list. As for your data, your url is wrong, you need to contact Massey or maybe the source of your information and get a valid internet address. Without one there's not much we can do. Rui Barradas Em 14-12-2016 12:16, Farshad Fathian escreveu: Hello, Thank

Re: [R] data manipulation

2016-12-14 Thread Rui Barradas
Hello, What do you mean by "gives me something"? xx <- read.csv("http://massey.ac.nz/~pscoperwait/ts/cbe.dat";) Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open URL 'http://massey.ac.nz/~pscoperwait/ts/cbe.dat': HTTP status

  1   2   3   4   5   6   7   8   9   10   >