Re: [R] How to save output of multiple loops in a matrix

2020-03-21 Thread Ioanna Ioannou
ity <- matrix(apply(VC_t, 1, function(x) paste(x, collapse = ','))) Vul$Y_vals <- Vulnerability From: Jeff Newmiller Sent: 21 March 2020 16:27 To: r-help@r-project.org ; Ioanna Ioannou ; r-help@r-project.org Subject: Re: [R] How to save output of mult

[R] How to save output of multiple loops in a matrix

2020-03-21 Thread Ioanna Ioannou
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

[R] How to create a vector by searching information in multiple data.tables in r?

2020-01-31 Thread Ioanna Ioannou
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

Re: [R] How to save multiple values of a variable in a json file in R

2020-01-16 Thread Ioanna Ioannou
ead and 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

[R] How to save multiple values of a variable in a json file in R

2020-01-16 Thread Ioanna Ioannou
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?

[R] How to save output of multiple unique loops in R.

2019-12-20 Thread Ioanna Ioannou
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,

[R] FW: How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread ioanna ioannou
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' &

Re: [R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioanna Ioannou
0,0), Prob.of.exceedance_3 = c(0.26,0.001,0.00019,0.00573,0.04,0.00017,0.000215,0.000472), Prob.of.exceedance_4 = c(0.72,0.03,0.008,0.61,0.475,0.0007,0.00435,0.000405) ) From: R-help on behalf of Ioa

[R] FW: How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioanna Ioannou
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' &

[R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioanna Ioannou
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' &

Re: [R] Manipulation of data.frame into an array

2018-05-24 Thread Ioanna Ioannou
From: Bert Gunter <bgunter.4...@gmail.com> 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 yo

[R] Manipulation of data.frame into an array

2018-05-24 Thread Ioanna Ioannou
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(

[R] Change values of a column based on the values of a third

2015-10-05 Thread IOANNA IOANNOU
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=

[R] FW: Completing Unordered Categorical missing variables using package mi

2015-06-18 Thread IOANNA IOANNOU
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.

[R] Completing Unordered Categorical missing variables using package mi

2015-06-18 Thread IOANNA IOANNOU
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.

[R] gaussian Kernel smoothing using Nadaraya-Watson estimator and confidence bands

2015-03-05 Thread IOANNA IOANNOU
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

[R] FW: FW: confidence intervals values in locpol

2015-03-04 Thread IOANNA IOANNOU
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.

[R] LInes with types

2014-05-28 Thread ioanna ioannou
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?

[R] grf in geoR

2014-03-31 Thread ioanna ioannou
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

Re: [R] grf in geoR

2014-03-31 Thread ioanna ioannou
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

Re: [R] Data manipulation in a data.frame

2014-02-21 Thread ioanna ioannou
)) 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, February 20

[R] Data manipulation in a data.frame

2014-02-20 Thread ioanna ioannou
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:

Re: [R] Identifying the bin where a value is included.

2013-09-18 Thread ioanna ioannou
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)

[R] Issue with using geocode

2012-11-25 Thread ioanna ioannou
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

[R] LOCFIT

2012-07-13 Thread Ioanna Ioannou
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