Questions tagged as 'r'

2
answers

Remove elements from a list that have part of a character or that are of a certain class

Consider the list: mylist=structure(list(quem = 1:10, quer = c(1.1, 2.1, 3.1, 4.1, 5.1), isso = structure(list(X__1 = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), X__2 = c(123, 456, 789, 1122, NA, 1788, NA, 2454, 2787, NA, 3453, 3786), X__3 =...
asked by 04.12.2018 / 04:10
2
answers

How to create a vector from another in r?

I need to create the vector fixo of NA and 0 from another vector coef . If coef<-c(1,4,10) then fixo = (NA,0,0,NA,0,0,0,0,0,NA) I tried to use str_detect : num<-c(1,4,10) maiorn <- max(num) A...
asked by 13.12.2018 / 20:50
2
answers

ks.test and p-value 2.2e-16

I'm trying to compare two distributions, however when I'm going to apply ks.test to both, just getting the value of 'D' and p-value coincidentally gives the same value for both, '< 2.2e-16 '. I had the idea of removing the values equal to zer...
asked by 31.08.2018 / 15:04
1
answer

How to remove legend on plot?

How can I remove the caption that is automatically generated in the plot function of the drc package? plot(curva5r, ylab= "Dose (%)", xlab = "Dose (g.e.a. de glyphosate ha-1)") Note that the caption stays on top of the p...
asked by 12.02.2018 / 18:46
2
answers

Plot hourly time series on a defined scale

I have a time series serial record, and I'm having trouble plotting on an appropriate scale. Here's an example: #Gerar sinal v1 v1=sin(seq(from=0, to=3*2*pi, length=11060)) #Gerar sinal v2 v2=sin(seq(from=0, to=5*2*pi, length=11060)) #G...
asked by 23.11.2017 / 14:22
2
answers

Filter Different texts in R

Good afternoon, I have the following data: NOME <- c("LEITO 1001", "LEITO 1002", "LEITO 1003", "LEITO 50", "LEITO 60") VALOR <- c(10, 20, 30, 40, 50) dados <- data.frame(NOME, VALOR) I need to filter only the "LEITO 1001" ,...
asked by 27.12.2017 / 18:14
2
answers

How does a forloop generate random values, then "append" the next set of generated values?

k <- 8 m = 100 for (i in 1:k){ x <- rnorm(mean = i, sd = .5, n=m) y <- rnorm(mean = (8-i), sd = .5, n=m) amostra2 <- data.frame(x,y) } This is the code I have. Given k and m,...
asked by 16.08.2018 / 05:20
2
answers

Check for different elements in a list in R

I have a list that each element is a data frame containing various information about a particular pension provider. In the CLASSE column there can only be one type and I need to know who has more than one type. How to create a colu...
asked by 26.09.2017 / 14:33
4
answers

Build database

I need to build a database with 200 rows and 4 columns (with the 4 variables I designed). I devised a study to estimate the presence of snakes in a particular city, I have no data. I thought the presence of snakes was due to these 4 variables: P...
asked by 09.10.2017 / 21:51
2
answers

How to create function where I need to pass the parameter inside a block of text in the R

I need the variable cnpj that is the <Parameter> tags to be called as a parameter of a function. But note that it is inside a block of text that I use to consume a web service. Is it possible in any way? recebeParam <- function...
asked by 25.07.2017 / 22:09