[R] Computing tetrachoric covariance matrices for multiple imputed datasets using MICE package

2020-04-24 Thread Ian McPhail
Using the mice package, I have created multiple imputed datasets to deal with missing data. I am looking for an example of the R code to use in order to analyze the set of imputed datasets using tetrachoric correlations in such a way that after pooling, I will have a combined tetrachoric covariance

[R] Options for zooming plots other than zm()

2020-04-24 Thread Robert Dodier
Hi, I am making some plots with plot() which have a fair number of points (thousands) and I would like to be able to interactively select a region of the plot and zoom in on it. I tried the zoom package which has the function zm() but I found that it was unworkably slow to refresh the display. I g

Re: [R] incidence_fit model for simulation

2020-04-24 Thread Sarah Goslee
According to this handy vignette, the object contains the predicted values in $pred https://cran.r-project.org/web/packages/incidence/vignettes/overview.html early.fit <- fit(i.7[1:20]) early.fit #> #> #> $model: regression of log-incidence over time #> #> $info: list containing the following it

[R] incidence_fit model for simulation

2020-04-24 Thread maicel
Hello How can I make a prediction with object type incidence_fit. incidence_fit object is returned by the function fit in library(incidence). Best regard maicel -- Este mensaje le ha llegado mediante el servicio de correo ele

Re: [R] Problem with loop in folders

2020-04-24 Thread Sarah Goslee
I suspect much if not all of your trouble would be eliminated by using file.path() instead of paste0(). https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/file.path (Also check your file name - you probably want a . between name and csv, so using paste(name, "csv", sep = ".") woul

Re: [R] Problem with loop in folders

2020-04-24 Thread Bert Gunter
What package is "read.dbf" from? What error message/behavior did you see? Should it be: path<-setwd(paste0("inpath/",folder)) ## did you forget the "/" ? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathe

[R] Problem with loop in folders

2020-04-24 Thread Shubhasmita Sahani
Hi Everyone, I am trying to loop through the folders in the major working directory. Read the dbf file into the data frame then save the data frame as CSV file in another folder. For this, I have written this code, But not able to figure out where it is going wrong. Any ideas will be of great suppo

Re: [R] [External] Re: Error in colouring by group in core plot R

2020-04-24 Thread luke-tierney
Or using matplot: matplot(cbind(g1, g2, g3), type = "l", col = c("red", "black", "blue"), lty = 1, lwd = 2) Best, luke On Fri, 24 Apr 2020, Jim Lemon wrote: Hi Luigi, This is pretty easy using "plot" and "lines": # assume your example data plot(g1,col ="red",type = "l", lwd = 2,

Re: [R] Error in colouring by group in core plot R

2020-04-24 Thread Rui Barradas
Hello, This is probably off-topic since you have chosen base graphics but this is much easier with ggplot. library(ggplot2) ggplot(df, aes(Index, Incidence, colour = Country)) + geom_line() + scale_colour_manual(values = c("red", "black", "blue")) + theme_minimal() Hope this helps,

Re: [R] Error in colouring by group in core plot R

2020-04-24 Thread Jim Lemon
Hi Luigi, This is pretty easy using "plot" and "lines": # assume your example data plot(g1,col ="red",type = "l", lwd = 2, xlab = "Days since start", ylab = "Count of infections", main = "Daily cases of COVID-19") lines(g2,col="black", lwd = 2) lines(g3,col="blue", lwd = 2) text(c(15,80,

Re: [R] Error in colouring by group in core plot R

2020-04-24 Thread Eric Berger
Hi Luigi, the problem is not the first graph vs the second graph. The first graph would also show the same effect if you added type='l' to the plot command. There are various ways to approach this. A quick search turned up the following which gives you different options. https://stackoverflow.com/q

[R] Error in colouring by group in core plot R

2020-04-24 Thread Luigi Marongiu
Hello, I am trying to make an epidemic plot of the COVID pandemic using the core plot function. I am looking at three countries and the countries are as factors. The idea is to colour the entry by country, following this scheme: ``` df = data.frame(index = 1:10, value = c(rnorm(10),

[R] R 4.0.0 is released

2020-04-24 Thread Peter Dalgaard via R-help
The build system rolled up R-4.0.0.tar.gz (codename "Arbor Day") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-4/R-4.0.0.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries for var