}
Vul <- distinct(d1[,c(1,2)])
dim(VC) <- c(length(unlist(str_split(as.character(d1[2,]$Y_vals), pattern =
","))),length(distinct(d1[,c(1,2)])$Name)) ## (rows, cols)
VC
VC_t <- t(VC)
Vulnerability <- matrix(apply(VC_t, 1, function(x) paste(x, collapse = ',')
Hello everyone,
I am having this data.frame. For each row you have 26 values aggregated in a
cell and separated by a comma. I want to do some calculations for all unique
names and taxonomy which include the four different damage states. I can
estimate the results but i am struggling to save the
Hello everyone,
Once again i am a bit stack. I have over 200 json files with information. I
managed to manipulate them and their format is rather difficult as shown below.
Unfortunately, not all these files contain the same fields. I want to extract
e.g., the country from all these files. How c
in some cases there will be one country reported and in some
others multiple. How can i optimise the code?
Best,
From: Rainer M Krug
Sent: 16 January 2020 14:47
To: Ioanna Ioannou
Subject: Re: [R] How to save multiple values of a variable in a json file in R
Ch
hello everyone,
and happy new year!
I have this problem: I want to save the name of the 'countries', the
'taxonomy_gem' and the 'minimum_im' and 'maximum_im' . The problem is that
there are several names of countries. How can i transfer the information from
the json file to an R data.frame? S
Hello everyone,
Could you please let me know how to create a new data.frame with the output of
the 2 unique loops. Essentially i want a data.frame with the IM, Taxonomy and
VC . MInd you VC is a vector with 33 elements.
Any ideas?
best,
ioanna
D<- data.frame(Ref.No = c(1622, 1623, 1624, 1625,
Hello everyone,
I have the following problem: I have a data.frame with multiple fields.
If I had to do my calculations for a given combination of IM.type and
Taxonomy is the following:
D <- read.csv('Test_v2.csv')
names(D)
VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & Taxo
.16, 0.16, 0.16, 0.16, 0.16, 0.16),
IM_1 = c(0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24),
Prob.of.exceedance_1 = c(0,0,0,0,0,0,0,0),
Prob.of.exceedance_2 = c(0,0,0,0,0,0,0,0),
Prob.of.exceedance_3 =
c(0.26,0.001,0.00
Hello everyone,
I have the following problem: I have a data.frame with multiple fields.
If I had to do my calculations for a given combination of IM.type and Taxonomy
is the following:
D <- read.csv('Test_v2.csv')
names(D)
VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & T
Hello everyone,
I have the following problem: I have a data.frame with multiple fields.
If I had to do my calculations for a given combination of IM.type and Taxonomy
is the following:
D <- read.csv('Test_v2.csv')
names(D)
VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & Tax
From: Bert Gunter
Sent: 24 May 2018 16:04
To: Ioanna Ioannou
Cc: r-help@r-project.org
Subject: Re: [R] Manipulation of data.frame into an array
This is one of those instances where a less superficial knowledge of R's
technical details comes in really handy.
What you need to do is conver
Hello everyone,
I want to transform a data.frame into an array (lets call it mydata), where:
mydata[[1]] is the first imputed dataset...and for each mydata[[d]], the first
p columns are covariates X, and the last one is the outcome Y.
Lets assume a simple data.frame:
Imputed = data.frame(
Hello all,
I have a rather easy question. I want to add a column to the database which
will change the values of vector a based on the values to vector b. Any
ideas how?
For example:
Dat <- data.frame(a= c('A','A','C','B','D','D','B'),
b= c('N','N','Y
Hello all,
A perhaps simple question. I am trying to complete unordered categorical
missing data using mi package. There are two variables with missing data:
Mat and Use. The problem is that the Use has several categories and somehow
this means I can't plot the results as I get this error.
Hello all,
A perhaps simple question. I am trying to complete unordered categorical
missing data using mi package. There are two variables with missing data:
Mat and Use. The problem is that the Use has several categories and somehow
this means I can't plot the results as I get this error. Any
Hello,
I have a database and I would like to fit a Nadaraya-Watson Gaussian kernel
estimator and produce the confidence bands around the mean estimate. Any
ideas how to do this with R? I cannot find a way to produce the confidence
bands. I will use a fixed bandwidth.
Lets use this database fo
Hello all,
A straightforward question. How can I get a the values of the 90%
confidence intervals of a locpol in R? I can see how you can plot the
mean as well as the confidence intervals. I would like the matrix of
the values corresponding to the 95% and 5% exceedance probability.
An
Hello all,
I want to plot the legend for the following two lines:
I have two lines:
X1<-c(0,1,2,3,4)
Y1<-c(0,1,2,3,4)
Y2<-c(5,6,7,8,9)
Y3<-(32,33,34,35,36)
plot(X1,Y3,pch=20)
lines(X1,Y1,lty=1,type='o')
lines(X1,Y2,lty=1,type='b')
lines(X1,Y3,lty=2)
Any ideas how?
Hello all,
A simple question. When I use grf from the package 'geoR' , I adopt the
exponential model. For this model is the parameter phi in m or km?
Best
ioanna
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing
Hello all,
A simple question. When I use grf from the package 'geoR' , I adopt the
exponential model. For this model is the parameter range in m or km?
Best
ioanna
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing
D,none))
Thanks in advance,
IOanna
-Original Message-
From: arun [mailto:smartpink...@yahoo.com]
Sent: 21 February 2014 00:19
To: r-help@r-project.org
Cc: ioanna ioannou
Subject: Re: [R] Data manipulation in a data.frame
Also,
rownames(which(t(!!A[,-1]),arr.ind=TRUE))
A.K.
On Thursday, Fe
Hello,
Assuming that I have a data frame
A<-data.frame(A=c(10,100,1000,30,50,60,300),
B=c(0,1,1,1,0,0,0),
C=c(0,0,0,0,1,1,0),
D=c(1,0,0,0,0,0,1))
What I would like is to introduce a new column Variable such that:
Hello all,
A very simple problem.
Lets assume I have an interval [0,1] and I split it in 6 bins having
thresholds:
pro= cbind(0, 0.3675509, 0.8618615, 0.9814291, 0.9975283, 0.9997789,
1.000,
0, 0.3662881, 0.8609743, 0.9812032, 0.9974822, 0.9997738,
1.000)
dim(pro)<-c(7,2)
Hello,
A very simple question but I am stuck. I have an excel file each row is an
address. However, I cannot make geocode read each line and come up with the
latitude longitude. Could you please correct my code?
library(ggmap)
X<-c (2 Afxentiou Ampelokipi Thessaloniki Greece, 2 Afxe
Hello,
I am using the locfit to fit a non parametric glm model to data with a gamma
distributed response variable. In the parametric glm regression the diagnostics
were based on the study of the standardized deviance or pearson residuals. How
can I estimate the the standardized Pearson residua
25 matches
Mail list logo