I have two data series with different scales and would like to plot the two on a single graph, the second is the derivative of the first. I'm using the code below but it does not work the way I want because it plots the data with only one Y-axis...
I want to cycle for but it is not working. My knowledge of 'R' is still meager. I want to calculate a F(y, x) = 1 + y + y^2 + ... + y^x = sum(y^(0:x)) function.
I wrote the following code, but it is giving a result that is not w...
I'm doing GLM for frequency data of a x behavior. Since I have day 1 and day 2 observations, I averaged the frequencies of that two days, so my count data are not integers. However, I can not make the models when I use the Poisson distributi...
I need to generate a new table with only the hourly rounds.
For example, from this table:
Thesedatawouldbeleft:
What is the best way to solve this problem in R?
I need a function that checks if all the coordinates of the vector are equal.
a = rep(1, 5)
Let the previous output be TRUE.
b = c(rep(1, 4),2)
Let the previous output be FALSE.
I have a percentage vector, for example,
v<- c(32.5 , 43.2 , 24.1)
> round(v)
[1] 32 43 24
> sum(round(v))
[1] 99
I want a function that handles my rounding so that it gets 100. In other words, I want a function fun so that...
How does order of operations work in R? And how can I change them?
For example, when I do 1 + 2^2 in R , it knows that it is first necessary to evaluate 2^2 and then add the result with 1 .
In this case, of course...
I need to make a glm in the R, but there is dependence between the data. I was asked to enter this dependency as a random factor in the analysis. But I'm not getting a command for this.
Overview:
- GLM, binomial
- 2 response variables and 2...
For an equation of type y = ax + b , we have two values for a and two for b , that is, we have four different equations.
We already have a code that returns the values of x and y for each equation separately. We...
I'm plotting lines on polygons, but when I try to insert the legend the lines look bad, how do I adjust that?
Without the Legend
library("ggplot2")
ggplot(mapa_mg) +
aes(x=long, y=lat, group=group) +
geom_polygon(fill = "white") +...