Dear friends - below is a subset of a much larger material showing two
ways of generating two "lines". The intention is to have the colour
reflect a variable, pH, but the legend is disturbed. The little part
marked "3" above the colour scale is unwelcome. Why did it appear? How
could I avoid it
Hi Bayan,
Your question seems to imply that the "age" column contains floating
point numbers, e.g.
df
height weight age
170 72 21.5
...
If this is so, you will only find an integer in diff(age) if two
adjacent numbers happen to have the same decimal fraction _and_ the
subtraction d
Hello everyone,
I have a plot showing chloride concentrations for various point over time.
I also have a dotted line that show the Secondary Maximum Contaminant Level
(my screening limit) on the graphs at 250 mg/L. But I can not figure out
how to include the dotted line / Secondary Maximum Contam
Dear all,
I am looking for a package that takes the likelihood function and use the L1
penalty for MLE. More specifically I would like to fit the Hawke process model
using the function likelihoodHawkes() in package "hawkes"
https://cran.r-project.org/web/packages/hawkes/hawkes.pdf. Had a look
[solved] -- As always, the solution is simple and I always feel foolish for not
having seen it right away.
Thank you, John, for showing that the frequency data can be "converted" to log
before the linear approximations are made.. once the linear approximations are
done with log data, the appro
Dear Rich,
I think that it's generally a bad idea to give statistical (as opposed to
simply technical) advice by email without knowing the context of the research.
I think that you'd do well to seek help from a statistician, and not just do
what I suggest below.
Interpolating the data only mak
My apologies for the typos in the code.
Here is a corrected version you can copy/paste in R to see the issue.
freq <- c(2, 3, 5, 10, 50, 100, 200, 300, 500, 750, 1000, 1300, 1800, 2450,
2900, 3000, 4000, 5000, 6000, 7000, 8200, 9300, 1, 11000, 18000, 26500,
33000, 4);
mag <- c(1.989303
Eric, John, thank you both very much for responding.
Ok.. I suppose I need to show more of the actual data.
I have this data:
freq <- c(2, 3, 5, 10, 50, 100, 200, 300, 500, 750, 1000, 1300, 1800, 2450,
2900, 3000, 4000, 5000, 6000, 7000, 8200, 9300, 1, 11000, 18000, 26500,
33000, 4)
ma
Hi,
Has anyone ever used the censtats from the nada package and carried it out
per group on a dataframe?
I have it working on the entire dataframe but I need to do it by group.
Thanks
--
Le gach dea ghui,
*Shane Carey*
*GIS and Data Solutions Consultant*
[[alternative HTML version del
Hi Bayan,
In your code, 'a' is a vector and is.integer(a) is a logical of length 1 -
most likely FALSE if even one element of a is not an integer. (Since R will
coerce all the elements of a to the same type.)
You need to decide whether something "close enough" to an integer is to be
considered an i
Hi
I want to clean my data frame, based on the age column, whereas i want to
delete the rows that the difference between its elements (i+1)-i= integer. i
used
a <- diff(df$age)
for(i in a){if(is.integer(a) == true){df <- df[-a,]
}}
but, it doesn’t work, any ideas
Thanks in advance
Bayan
___
Hi Eric,
Thanks for the help.But this will not solve the problem as it will generate a
list and what I need is an object of class sp using SpatialLine function from
sp package.So, I need to convert each matrix to coordinates and then to a line
and then to a spatial line as figured in the code.
Hi Ashraf,
In that case I think you may need to structure the code to first build the
list and only at the end supply that to the SpatialLines function,
something like
test.func <- function(x) {
tt <- list()
for ( i in ... ) {
...
tt[[i]] <- (whatever)
}
return(Spati
Quite so. Very sorry everyone. I realised that I meant "useNA="always"" not
"na.rm=TRUE" within minutes of sending that Email ... by which time I was
travelling and no longer had internet to beat you to this Eric.
Clear evidence that I should never touch the keyboard without the first coffee
o
Hi Chris,
Maybe the na.rm=TRUE is affecting things. Try this
apply(datTAF[,75:78],2,function(x){ sum(!is.na(x)) })
HTH,
Eric
On Tue, Sep 26, 2017 at 9:53 AM, Chris Evans wrote:
> I am hitting an odd message "Error in FUN(newX[, i], ...) : all arguments
> must have the same length". I can't su
Hi Rich,
If I understand your comment about "uniformly distributed along the log=x
axis" then I think John's (second) set of commands needs a change to the
definition of xx, as follows:
xx <- exp(seq(from=log(min(x)),to=log(max(x)),length=50))
m <- lm(y ~ log(x))
yy <- predict(m, data.frame(x=xx))
16 matches
Mail list logo