Questions tagged as 'r'

2
answers

How to add a second Y-axis using the matplot function?

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...
asked by 23.10.2015 / 22:12
2
answers

cycle for calculating a function

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...
asked by 27.10.2018 / 22:19
1
answer

GLM, Poisson - non-integer count numbers (average)

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...
asked by 21.08.2015 / 20:52
1
answer

How to remove specific rows from a data frame?

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?     
asked by 02.04.2015 / 13:34
2
answers

Comparison of elements of a vector

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.     
asked by 26.09.2015 / 02:54
3
answers

in R, create a vector rounding function so that the coordinates are 100

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...
asked by 13.02.2015 / 15:42
1
answer

Order of operations in R

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...
asked by 03.10.2014 / 13:42
1
answer

GLM with random factor in R

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...
asked by 27.06.2014 / 16:25
1
answer

How to vary parameters of an equation?

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...
asked by 23.03.2014 / 20:29
1
answer

How do I set the tab for spatial lines in ggplot?

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") +...
asked by 08.07.2018 / 02:02