[R] RSTAN

2021-06-19 Thread peri He
Dear Friends, I have started to write some codes for RSTAN, I have a general question regarding likelihood function. Below you can see a simple structure of RSTAN model. For most of the codes, in the "model" block, I saw priors (hyperpriors) and likelihood functions. In a few programs, I don't s

[R] Legend position in ggplot

2021-06-17 Thread peri He
Dear Friends, I would like to see my legend outside of a ggplot (at the top). This code is showing the legend inside of a plot: theme(legend.position=c(0.15,0.97)) But when I changed it to : theme(legend.position=c(-0.15,1.5)) , the legend disappears. I would appreciate it if you share your id

[R] RINLA

2021-06-09 Thread peri He
Dear Friends, I am running a simple code for rinla. The INLA package is installed successfully on Rstudio. But when I run inla (y~x,..) function, I get the following error: could not find function "inla" Did anybody have the same problem before? I would appreciate it if any information is

[R] multiple time series plots

2020-09-17 Thread peri He
Dear Friends, I am trying to add two time series curves into one plot. I don't get any error but the lines are not added to my plot. I am trying the following code; 1) df <- as.data.frame (read_excel("C:/Users/NO2.xlsx", "trend)) 2) plot(df$year, df$Nation, type="o", col="blue", lty=1, ylab="ch

[R] Installation of a source package in R

2020-07-21 Thread peri He
Hello, I have installed all packages successfully in order to unpack a source package. I am still getting error when I run: install.packages ("package.tar.gz', repos = NULL, type = "source"). Is that possible my system doesn't allow Rstudio to compile some information in C++ ? My colleague is