Displaying 11 results from an estimated 11 matches for "garziano".
2016 Apr 22
1
Finding Highest value in groups
Since the aggregate S3 method for class formula already has got na.action = na.omit,
## S3 method for class 'formula'
aggregate(formula, data, FUN, ...,
subset, na.action = na.omit)
I think that to deal with NA's, it is enough:
aggregate(Value~ID, dta, max)
Moreover, passing na.rm = FALSE/TRUE is "don't care":
aggregate(Value~ID, dta, max, na.rm=FALSE)
2016 Apr 30
1
selection columns by type, ie, numeric
My? thanks to Bill Dunlap and??Giorgio Garziano for? their help.?? It is greatly appreciated.? I works so well, wow.
Carl Sutton CPA
[[alternative HTML version deleted]]
2016 Apr 05
0
R cases on predictive maintenance
Generically:
http://rseek.org/?q=predictive+maintenance
and among those:
https://rpubs.com/Simionsv/97830
http://blog.revolutionanalytics.com/2016/03/predictive-maintenance.html
--
Best,
GG
This Communication is Ericsson Confidential.
We only send and receive email on the basis of the term set out at http://www.ericsson.com/email_disclaimer
[[alternative HTML version deleted]]
2016 Apr 06
0
Good pointers for understanding the R language implementation
Guessing that you may want to take a look at:
http://adv-r.had.co.nz/Expressions.html
https://www.opencpu.org/
Anyway, as David wrote, that it is too vague for specific hints.
--
Best,
GG
[[alternative HTML version deleted]]
2016 Apr 06
0
Plotting data on a map
Some tutorials and examples may help.
http://www.zoology.ubc.ca/~kgilbert/mysite/Miscellaneous_files/R_MakingMaps.pdf
http://coulmont.com/cartes/rcarto.pdf
https://pakillo.github.io/R-GIS-tutorial/
http://www.milanor.net/blog/maps-in-r-plotting-data-points-on-a-map/
https://www.youtube.com/watch?v=PTti7OMbURo
https://www.nceas.ucsb.edu/scicomp/usecases/CreateMapsWithRGraphics
--
Best,
GG
2016 Apr 20
0
Add a vertical arrow to a time series graph using ggplot and xts
Please see updates to df2 assignment as shown below.
library(xts) # primary
#library(tseries) # Unit root tests
library(ggplot2)
library(vars)
library(grid)
dt_xts<-xts(x = 1:10, order.by = seq(as.Date("2016-01-01"),
as.Date("2016-01-10"), by = "1 day"))
colnames(dt_xts)<-"gdp"
xmin<-min(index(dt_xts))
2016 Apr 22
0
subset by multiple letters condition
You may investigate a solution based on regular expressions.
Some tutorials to help:
http://www.regular-expressions.info/rlanguage.html
http://www.endmemo.com/program/R/grep.php
http://biostat.mc.vanderbilt.edu/wiki/pub/Main/SvetlanaEdenRFiles/regExprTalk.pdf
https://rstudio-pubs-static.s3.amazonaws.com/74603_76cd14d5983f47408fdf0b323550b846.html
2016 Apr 22
0
Finding Highest value in groups
idvalues <- data.frame (ID = c(1, 1, 2, 2, 3, 4, 4, 4, 5, 5),
Value = c(0.69, 0.31, 0.01, 0.99, 1.00, NA, 0,1, 0.5, 0.5))
aggregate(Value~ID, data=idvalues, max)
ID Value
1 1 0.69
2 2 0.99
3 3 1.00
4 4 1.00
5 5 0.50
--
Best,
GG
[[alternative HTML version deleted]]
2016 Apr 24
0
Inserting a blank row to every other row
Starting from this data frame:
my.df <- data.frame(num = 1:5, let = letters[1:5])
> my.df
num let
1 1 a
2 2 b
3 3 c
4 4 d
5 5 e
>
and inserting a blank row (NAs row) for each one of my.df rows.
na.df <- data.frame(num = NA, let = NA)
my.df <- do.call(rbind, apply(my.df, 1, function(x) {rbind(x, na.df)}))
> my.df
num let
1 1 a
2 <NA>
2016 Apr 24
0
multiplication by groups
df1 <- data.frame(ID = c(1,1,2,2,3,3,4,4,5,5),
A = c(1,0,5,1,1,NA,0,3,2,7),
B = c(2,3,NA,3,4,NA,1,0,5,NA))
df2 <- data.frame(ID = c(1,2,3,4,5),
A = c(1,6,1,3,9),
B = c(5,3,4,1,5))
m <- match(df1$ID, df2$ID)
sel <- c("A", "B")
for (i in 1:nrow(df1)) {
df1[i,sel] <-
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
Hi,
I was able to replicate the solution as suggested by William in case of
data.frame class, not in case of data.table class.
In case of data.table, I had to do some minor changes as shown below.
library(data.table)
a <- 1:10
b <- c("a","b","c","d","e","f","g","h","i","j")
c <- seq(1.1,