Questions tagged as 'r'

2
answers

script about program R

I'm using R to extract data in .h5 format. I am getting it. However, they are 200 years, and monthly data. For the moment, I can only call a file every month at a time, but I need to be able to do a script where I can extract the data...
asked by 15.07.2015 / 22:21
1
answer

Convert qualitative numerical variables into factors in R

I have the following code, READY, that my supervisor passed to me fatores=c("Year","Month","DayofWeek","DayofMonth") dadosFatores=apply(dados[,fatores],2,XXXX) dados[,XXXX]=dadosFatores In the exercise says that I should only change the...
asked by 26.11.2014 / 03:57
1
answer

Error in View: invalid caption argument [closed]

I was moving the following script: library(tidyverse) library(dplyr) library(readxl) cirurgia <- read_excel("C:/Users/Agnes/Desktop/Coisas com R/R/2_MIOMECTOMIA_HISTERECTOMIA-MAR_SET-2017.xlsx", sheet = "Plan1",...
asked by 01.12.2018 / 23:10
3
answers

Comparing matrices of different sizes in R

I have the following situation: all_sec = Matrix of all possible assets in a portfolio all_sec <- matrix(c("SEC1","SEC2","SEC3","SEC4","SEC5"),ncol=1) portfolio < - composition of an asset portfolio (column 2 is equal to the weight...
asked by 15.07.2014 / 17:52
2
answers

Selecting / Cleaning information in a column

I have a database with thousands of rows, but in one of the columns the data looks like this: XLOCAL Estirão do Equador, Rio Javari (04°27'S;71°30'W) Alto Rio Paru de Oeste, Posto Tiriós (02°15'N;55°59'W) Ipixuna do Pará, Rodovia Belém-Brasíli...
asked by 24.10.2018 / 00:36
2
answers

Find a number after a specific word with grepl and regex {r}

Hello, I have a list of addresses and I am trying to check which ones have numbering and which ones do not. However, I have some strings that end with number and I'm trying to create a regex to filter those results. I do not want you to return n...
asked by 02.08.2018 / 22:23
2
answers

Generate multiple graphs in one loop using x11 () and two different indices in R

Personal this is my list. mylist=list(list(a = c(2, 3, 4, 5), b = c(3, 4, 5, 5), c = c(3, 7, 5, 5), d = c(3, 4, 9, 5), e = c(3, 4, 5, 9), f = c(3, 4, 1, 9), g = c(3, 1, 5, 9), h = c(3, 3, 5, 9), i = c(3, 17, 3, 9), j = c(3, 17, 3, 9...
asked by 24.08.2018 / 04:35
1
answer

Get previous values of a variable if the current value is 0 with a condition using dplyr in R

I have a database as follows: CNPJ data dataquebra alto 2222 201603 201711 s 2222 201511 0 s 2222 201702 201711 s 2222 201704 201711 s 3333 201601 201711 s 3333 201509 0 s...
asked by 11.07.2018 / 16:27
1
answer

Can you take the percentage of the standard deviation (R)?

For example .. I have a series of values (prices) related to a product on several different dates. I need to get the percentage change of this value. Currently, prices are giving a standard deviation of 120.00, but I wanted that result...
asked by 09.07.2018 / 20:06
2
answers

r - average of one variable in relation to the values of another variable in a data frame and withdraw values NA

I have a multi-column dataframe. How do I calculate the average of one of the variables based on the values of another variable? I have the frequency of several species found in 4 campaigns and I want to calculate the average of each recorded sp...
asked by 23.07.2018 / 22:33