similar to: my R code worked well when running the first 1000 lines of R code

Displaying 20 results from an estimated 400 matches similar to: "my R code worked well when running the first 1000 lines of R code"

2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
I am sorry that I know I should provide a dataset that allows to replicate my problem. It is a research dataset and quite large, so I can not share. Both Bert and Tim guessed my problem correctly. I also thought about the conflicting issue between different packages and function masking. I just hope to that someone has similar experience, so providing me suggestion. For conflicting issue,
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
Hello, Inline. ?s 19:03 de 12/06/2024, Yuan Chun Ding via R-help escreveu: > I am sorry that I know I should provide a dataset that allows to replicate my problem. > > It is a research dataset and quite large, so I can not share. > > Both Bert and Tim guessed my problem correctly. I also thought about the conflicting issue between different packages and function masking. > I
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
Hi Rui, Thank you very much! Yes, I verified using real data, it worked correctly as expected after adding tidyr:: to the pivot_longer function and dplyr:: to the group_by and summarize Function. I did not know how to assign the tidyr and dplyr to the three functions because I do not really understand well the three functions and just got the code from a google search. I also tried your
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
I sometimes think people on this list are quite rude to posters. I'm afraid I'm likely to join in with some rudeness? 1. "Here is some code that works but also doesn't" is probably not going to get you an answer 2. I provide no information about the data it works on or doesn't 3. I tell you I'm using a load of dependencies, but don't tell you what 4. I refer to
2013 Apr 03
5
Can package plyr also calculate the mode?
I am trying to replicate the SAS proc univariate in R. I got most of the stats I needed for a by grouping in a data frame using: all1 <- ddply(all,"ACT_NAME", summarise, mean=mean(COUNTS), sd=sd(COUNTS), q25=quantile(COUNTS,.25),median=quantile(COUNTS,.50), q75=quantile(COUNTS,.75), q90=quantile(COUNTS,.90), q95=quantile(COUNTS,.95), q99=quantile(COUNTS,.99) )
2008 Apr 03
1
prettyR 25% quartile, 75% quartile
I am using the describe function in prettyR. I would like to add the 25% 75% quartiles to the summary table how do I do this I have tried describe(x.f, num.desc=c("mean", "median", "sd", "min", "max", "skewness", "quantile(x.f, na.rm=T, probs=seq(0.25, 0.75))", "valid.n")) help -- Let's not spend our time
2008 Jun 19
1
PrettyR (describe)
#is there a way to get NA in the table of descriptive statistics instead of the function stopping Thank you in advance #data x.f <- structure(list(Site = structure(c(9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L), .Label = c("BC", "HC", "RM119", "RM148", "RM179", "RM185",
2012 Oct 22
0
Lattice to ggplot2: Reference graphics across facets
Hi, I'm playing with moving some of my lattice graphics into ggplot2, and I'd like to ask how to achieve a couple of things, both of which are fully illustrated in self-contained code (and mostly minimal, although that left quite a bit) following this written description. 1. I quite often like to use a 'ghosted' reference across facets - for example, in my example program below,
2023 May 02
1
Reg: Help regarding ggplot2
It's not clear what you want but ... On 02/05/2023 10:57, Upananda Pani wrote: > Dear All, > > I have a dataset which contains date and 12 other countries data. I > have extracted the data as xts object. > > I am not able to recall all the series in the Y axis. My data set > looks like this > > index crepub finland france germany italy netherlands norway poland >
2018 May 11
3
add one variable to a data frame
Hi Sarah, Thank you so much!! I got your good ideas. Ding -----Original Message----- From: Sarah Goslee [mailto:sarah.goslee at gmail.com] Sent: Friday, May 11, 2018 11:40 AM To: Ding, Yuan Chun Cc: r-help mailing list Subject: Re: [R] add one variable to a data frame [Attention: This email came from an external source. Do not open attachments or click on links from unknown senders or
2018 May 11
0
add one variable to a data frame
Sarah's solutions are good, and here's another, even more basic: tmp1 <- unique(dat1$B) tmp2 <- seq_along(tmp1) dat1$C <- tmp2[ match( dat1$B, tmp1) ] > dat1 N B C 1 1 29_log 1 2 2 29_log 1 3 3 29_log 1 4 4 27_cat 2 5 5 27_cat 2 6 6 1_log 3 7 7 1_log 3 8 8 1_log 3 9 9 1_log 3 10 10 1_log 3 11 11 3_cat 4 12 12 3_cat 4 As a single line
2023 Apr 04
1
Simple Stacking of Two Columns
Just to repeat: you have NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly")) and you want NamesLong<-data.frame(Names=c("Tom","Dick","Larry","Curly")) There must be something I am missing, because NamesLong <- data.frame(Names = c(NamesWide$Name1, NamesWide$Name2)) appears to
2023 Oct 31
1
weights vs. offset (negative binomial regression)
[Please keep r-help in the cc: list] I don't quite know how to interpret the difference between specifying effort as an offset vs. as weights; I would have to spend more time thinking about it/working through it than I have available at the moment. I don't know that specifying effort as weights is *wrong*, but I don't know that it's right or what it is doing: if I were
2018 Jan 14
2
consolidate three function into one
Hi Bert, I am sorry to bother you on weekend. I am still struggling on defining a correct function. I first defined the function RFS (see below), then run it by provide the two argument. m52.2cluster <-RFS(inputfile =allinfo_m52, N=2 ) I do not get error message, but no figure displays on screen. I do not know what is going on. Can you help me a little more on this issue? Thank you,
2018 Jan 15
2
consolidate three function into one
Hi Richard, Thank you so much!! I understand the problem now, I assign a name to the "ggsurvplot" object and then add print(fig) at bottom of function definition, now figure gets printed on screen. Ding # function to generate RFS curves RFS <- function( inputfile, N ) { cluster<- survfit(Surv(RFS_days2, OV_Had_a_Recurrence_CODE) ~ clusters, data =
2018 May 11
3
add one variable to a data frame
Hi All, I have a data frame dat1: dat1 <-data.frame(N=seq(1, 12,1), B=c("29_log","29_log", "29_log", "27_cat", "27_cat", "1_log", "1_log", "1_log", "1_log", "1_log",
2018 Jan 14
0
consolidate three function into one
FAQ 7.22 You must print a ggplot object, for example with print(m52.2cluster) For the FAQ, run the line system.file("../../doc/FAQ") in R on your computer. Open up the resulting filepath in your favorite editor and scroll down to 7.22 On Sun, Jan 14, 2018 at 4:21 PM, Ding, Yuan Chun <ycding at coh.org> wrote: > Hi Bert, > > I am sorry to bother you on weekend. >
2018 Jan 15
1
consolidate three function into one
Thank you, your suggestion is simpler and logically better. I had impression that the last object in a function gets returned, so I did not add the print function at the bottom line of the function definition. Returning an object and graph the object are different process, I am a beginner for writing R function and need to find a good guide source about writing R functions. If you know a good
2018 Jan 15
0
consolidate three function into one
That is certainly OK, but you can also just use print(ggsurvplot(...)) as your final statement. out <- RFS( ...) would then return the ggsurvplot object *and* graph it. Any good R tutorial or a web search will provide more details on function returns, which you might find useful. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and
2018 May 11
0
add one variable to a data frame
Hi, Here's one way to approach it, using the coercion of factor to numeric. Note that I changed your data.frame() statement to avoid coercing strings to factors, just to make it simpler to set the levels. dat1 <-data.frame(N=seq(1, 12,1), B=c("29_log","29_log", "29_log", "27_cat", "27_cat", "1_log", "1_log",