Questions tagged as 'r'

2
answers

Use "NA" in logical operation in R

I have the situation: a = c(1,2,3, NA, 5, 6, NA) b = 99 for(i in 1: 7){ if(a[i] == "NA"){ a[i] = b } } The problem is that R does not make the logical comparison using "NA" or NA.     
asked by 22.09.2014 / 19:42
2
answers

counter function of reshape2 :: melt (tear)

I'm working with data.frame and it's organized in long format. But I'd like to put it in wide format based on a variable ( FAT2 ) such that the column layouts would be: AVA , FAT1 , Banana , Ingá , Gliricí...
asked by 10.12.2018 / 15:51
1
answer

How to add margins and text to the plot?

I would like to know how to remove the rows of the graph margins in the R itself (ex: image 1) and add the value of the correlation of the modeled curve to the coefficient of determination (R²). library(drc) S.alba.m1 <- drm(D...
asked by 12.02.2018 / 22:26
2
answers

WebScrape placar previdencia

I needed to extract the information from this site to an excel file, which MPs vote for, against, abstention, anyway. It's a webspace exc, but as I understand html I'm having trouble understanding the nodes. I've tried read_html , readH...
asked by 07.04.2017 / 22:24
2
answers

How to add a same substring across multiple columns in R

I have a base with 2 rows and 68 observations called "varnomes" and would like to add the word "PF" at the end of each observation. With this, I tried to use the paste function: varnomes<-paste(varnomes,"PF") But I did not succeed. Th...
asked by 13.03.2017 / 21:34
2
answers

How to rename all Environment dataframes with a specific name [R]

The Environment is: But,Iwanttoconvertto: where dataset is the specific name.     
asked by 22.08.2018 / 15:59
1
answer

How to check if all values are equal in a vector in r

I have as a function answer the RMSEA, GFI, NFI and CFI vectors that can contain all the same values. In the sequence I use the algorithm below to test the normality through the shapiro-wilk test. When the values are all equal it returns error o...
asked by 05.09.2018 / 22:47
1
answer

Monitoring with the R

I have a tracking script and would like to run it every five minutes, is there any function that does this? For example: função (meu_script, repetir= 5 minutos) I tried some functions with Sys.time() and proc.time() , but I...
asked by 28.02.2018 / 18:12
3
answers

Delete the "X" in the Header in the R

I am importing a csv file into the R and the name of each column is showing the letter "X" before the original name. For example: Field names in csv: 1.2_cidade ; 2_UF . Field names after import: X1.2_cidade ; X2_UF ....
asked by 02.02.2018 / 15:17
2
answers

In R, How to calculate the average of one column based on criterion in another column?

I have two columns (A and B) I want to calculate the average of column A for the corresponding elements only for those in column B are greater than 10 for example.     
asked by 11.02.2018 / 19:34