Each dataframe is a gridded file, so I want to add the values at
corresponding grid cells from all the dataframes.
On Mon, Mar 25, 2019 at 6:22 PM Rui Barradas wrote:
> Sorry, I forgot to ask something.
>
> When you say you want to add the df's values, what exactly do you mean?
> All of the valu
> ratio1 <- with(dat, sum(v1,na.rm = TRUE)/sum(v3,na.rm=TRUE))
> ratio1
[1] 1.2
It looks like you should spend some more time with an R tutorial or two.
This is basic stuff (if I understand what you wanted correctly).
Also, this is not how a "confidence interval" should be calculated, but
that is
This is fantastic ! It was exactly what I was looking for. It is part
of a larger Shiny app, so difficult to provide a working example as part
of the post, and after figuring out how your code works ( I am an R
novice), I made a couple of small tweaks and it works great ! Thank you
very much,
Hi R User,
I was trying to calculate ratios with confidence interval using Monte Carlo
simulation but I could not figure it out.
Here is the example of my data (see below), I want to calculate ratios
(dat$v1/dat$v3 & dat$v2/dat$v3) and its confidence intervals using a 100
randomly selected data set
"Does anyone know how to use loop (or other methods) to create new columns?
In SAS, I can use array to get it done. But I don't know how to do it in R."
Yup. Practically all users of R know how, as this is entirely elementary.
You will too if you make the effort to go through a basic R tutorial, o
R Notebook
You forgot to provide what your test data looks like. For example, are all
the columns a single letter followed by “_" as the name, or are there
longer names? Are there always matched pairs (‘le’ and ‘me’) or can singles
occur?
Hide
library(tidyverse)# create some data
test <- tibble(a
Hi All,
I have a data frame with variable names like A_le, A_me, B_le, B_me, C_le,
C_me
if A_le=1 or A_me=1 then I need to create a new column A_new=1. Same operation
to create columns B_new, C_new...
Does anyone know how to use loop (or other methods) to create new columns? In
SAS, I can
Dear R users,
Are you worried about the parallel trends assumption in your panel
regression? Use fixed effects individual slope models, controlling for
heterogeneous trends!
I am very pleased to announce that the package feisr is now available on
CRAN!
CRAN: https://cran.r-project.org/package=fe
Excellent, thanks! (It just goes to show how hard it can be to find
something when you don't know precisely what to look for.)
DLG
On Mon, Mar 25, 2019 at 8:18 AM Ivan Krylov wrote:
> On Sun, 24 Mar 2019 23:35:30 -0700
> David Goldsmith wrote:
>
> > No way to "export" a (Quartz) plot...
> > .
If the grid is not full you need to identify the missing cells. As an example
we can remove rows 3 and 6 from DF1:
> DF1miss <- DF1[-c(3, 6), ]
> DF2miss <- xtabs(Precip~latitude+longitude, DF1miss)
> DF2miss
longitude
latitude 110.5 111 111.5 112
45.5 3.2 5.0 0.0 2.0
46 6
Here are a couple of other options. One changes the console width and the other
pads the matrix before printing:
> # Print rows of 10 values
> x <- 1:25
> # Basically cheating and you don't get column numbers
> # wd depends on the size of the values and the number
> # of values
> wd <- (floor(log
On Sun, 24 Mar 2019 23:35:30 -0700
David Goldsmith wrote:
> No way to "export" a (Quartz) plot...
> ...once I've got it the way I want it, (e.g., to a PNG)
Well, there seems to be a quartz.save() function, but I cannot attest
to its well-behavedness, not having a Mac to test it on.
--
Best reg
Doing a web search on
R CRAN GJR GARCH
brought up the rugarch package. The models you mentioned are discussed in
the documentation to that package
https://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf
On Mon, Mar 25, 2019 at 2:06 PM Amon kiregu wrot
what is the r code for simulating PowerGARCH,Threshold GARCH,and GJR GARCH
in order to capture heteroscedasticity,volatility clustering,etc,,so that i
can have simulation of mean part and simulation on innovation part.
thanks
[[alternative HTML version deleted]]
_
...once I've got it the way I want it, (e.g., to a PNG)? I.e., I either
have to create a PNG device and then plot to that, or use Mac's (screen)
"Grab" app? Thanks.
DLG
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.
Sorry, I forgot to ask something.
When you say you want to add the df's values, what exactly do you mean?
All of the values, by row, by column, what?
Rui Barradas
Às 10:20 de 25/03/2019, Rui Barradas escreveu:
Hello,
Maybe something like this?
Note that you *never* need to set header = FALS
Hello,
Maybe something like this?
Note that you *never* need to set header = FALSE, it already is the
default of read.table. You would have to with read.csv.
old_dir <- setwd("~/directory")
f1990 <- list.files(pattern = "^199.*\\.txt$")
r1990 <- lapply(f1990, read.table)
setwd(old_dir)
Hope
Hi R users,
I have multiple dataframes in a directory, and with the same postfix
".txt". Each dataframe is a gridded file with just values, but each value
represents one grid cell. There are many years, and each year has 12
months, so there are many such files. For each year, I want to read the
co
Hi John,
dplyr::lag expects a vector. The following should work
dplyr::lag(temp[,1],2)
HTH,
Eric
On Mon, Mar 25, 2019 at 9:45 AM John wrote:
> Hi,
>
>I have a dataset whose row names corresponds to months. When I apply lag
> function (dplyr package) on this dataset, I get NAs with warning
Hi,
I have a dataset whose row names corresponds to months. When I apply lag
function (dplyr package) on this dataset, I get NAs with warning messages.
Is there any lag function that carries out the lag but keep the row names?
I will have two datasets. The dates of the datasets are not exact
Hi!
2019-03-25 kello 09:30 +0800, Steven Yen wrote:
> The second command is ugly. How can I print the 25 numbers into 2
> rows
> of ten plus a helf row of 5? Thanks.
Something like this?
x<-1:25; for (i in seq(1,length(x),10))
print(x[i:ifelse((i+9)>length(x),length(x),i+9)])
HTH,
Kimmo
_
21 matches
Mail list logo