Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-27 Thread Richard O'Keefe
I'm retired, and I had an hour on my hands while tea cooked and my granddaughter did her homework, and I just *love* showing off how helpful I am. Good news: someone finally looked at your data. (That would be me.) Bad news: it's going to be a lot of work to do what you want to, and YOU SHOULDN'T

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread Jeff Newmiller
But "disappearing" is not what NA is supposed to do normally. Why is it being treated that way here? On July 27, 2022 7:04:20 PM PDT, John Fox wrote: >Dear Rolf, > >The coefficient of TrtTime:LifestageL1 isn't estimable (as you explain) and by >setting it to NA, glm() effectively removes it fro

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread Rolf Turner
On Thu, 28 Jul 2022 00:42:51 + "Ebert,Timothy Aaron" wrote: > Time is often used in this sort of problem, but really time is not > relevant. A better choice is accumulated thermal units. The insect > will molt when X thermal units have been accumulated. This is often > expressed as degree d

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread John Fox
Dear Rolf, The coefficient of TrtTime:LifestageL1 isn't estimable (as you explain) and by setting it to NA, glm() effectively removes it from the model. An equivalent model is therefore > fit2 <- glm(cbind(Dead,Alive) ~ TrtTime + Lifestage + + I((Lifestage == "Egg + L1")*TrtTime

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread David Winsemius
On 7/27/22 17:26, Rolf Turner wrote: I have a data frame with a numeric ("TrtTime") and a categorical ("Lifestage") predictor. Level "L1" of Lifestage occurs only with a single value of TrtTime, explicitly 12, whence it is not possible to estimate a TrtTime "slope" when Lifestage is "L1". Ind

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-27 Thread avi.e.gross
Ranjeet, As others have said, you have not shown enough to get decent answers. What you describe sounds quite routine and is the first step many have to do when gathering data from disparate sources that were done by different people without much consideration it has to follow some specific pat

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-27 Thread Ebert,Timothy Aaron
I think what you want is full_join() from the dplyr package. https://www.rdocumentation.org/packages/dplyr/versions/0.7.8/topics/join The only requirement is that both data frames must have a column in common wherein the data are entered in the same way. So the column labeled "state" needs to ha

Re: [R] Request concerning use in book

2022-07-27 Thread Ebert,Timothy Aaron
My understanding is that the only requirement is to give proper credit. This is necessary anyway as readers would need to know what packages were used and what version of R was used. In R there is the citation() function that returns the approved citation. However, it might be useful to also inc

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-27 Thread Ranjeet Kumar Jha
Hi Petr, I used r-bind but it's not working. Here is the code: arhar_18<-read.csv("D:/Ranjeet/IAMV6/input/yield/kharif_18-19_yield/Kharif_2018/arhar_18.csv") dacnet_17<-read.csv("D:/Ranjeet/IAMV6/input/yield/dacnet_yield_update till 2019.csv") for(cr in seq_along(dacnet_17$district)){ match(

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-27 Thread PIKAL Petr
Hi. „is not working“ is extremelly vague. 1. What do you expect this code do? for(cr in seq_along(dacnet_17$district)){ match(arhar_18$district, dacnet_17$district) } See ?match and maybe also ?“for“ and try this x <- letters[1:5] y <- sample(letters, 100, replace=T) ma