Questions tagged as 'r'

2
answers

Catch only last month using R

I need to extract the last monthly values from column 2 of dataframe ntnb45 . Is there any direct way to do this in R? library(GetTDData) ntnb <- download.TD.data('NTN-B') ntnb45 <- read.TD.files(dl.folder = 'TD Files',maturity = '...
asked by 24.03.2017 / 21:20
2
answers

Rename the levels of a factor based on a data frame

Suppose I have the date frame iris , present in the memory of R: head(iris) Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4...
asked by 02.12.2017 / 20:11
2
answers

Filter Different texts in different positions in R

Good afternoon. I have the following data: NOME <- c("MARIA 1001", "MARIA 1002A", "JOSE 1003B", "PEDRO 1003", "CARLOS 1019J", “ANTONIO 50”, “MARIA 80”) VALOR <- c(10, 20, 30, 40, 50, 60, 70) dados <- data.frame(NOME, VALOR) I need...
asked by 28.12.2017 / 15:14
1
answer

Creating a bar chart within another bar chart

I'm looking for a very efficient and useful way to use nested bar charts. A way in which you can demonstrate divisions and subdivisions in the same chart. How to generate such a graph in R?     
asked by 22.09.2014 / 20:13
1
answer

Functional programming: applicability of parameters (.x) and (.) in purrr :: map

I am migrating to the package purrr , mainly in relation to the use of the map function. But, I'm having a hard time understanding the concepts of functional programming in purrr . I would like to learn to apply the (....
asked by 04.01.2019 / 16:36
1
answer

Web scraping to collect scientific articles on ScienceDirect

I'm trying to use R to select ScienceDirect page articles using keywords. I was able to extract pdfs from a page last week, using the page source information. The code used was as follows: base.url = "http" doc.html <- htmlParse(base.url) d...
asked by 13.10.2014 / 17:44
2
answers

How to remove a column from the data.frame in R?

Suppose a generic data.frame, such as: set.seed(1) dados <- data.frame(y=rnorm(100), x= rnorm(100), z=rnorm(100), w=rnorm(100)) head(dados) y x z w 1 -0.6264538 -0.62036668 0.4094018 0.8936737 2 0.1...
asked by 17.02.2014 / 18:10
1
answer

Execution of multiple functions within loops * pply

dput : dataset=structure(list(var1 = c(93.6192987300456, 89.1180437617004, 73.1943506933749, 99.0350881963968, 32.3240431956947, 94.2517145164311, 53.7740966491401, 64.1642983071506, 83.643307145685, 27.0992671512067, 84.45406595245,...
asked by 26.11.2018 / 18:01
1
answer

How to implement mappers in R?

I would like the answer to contain information about: What are mappers? How to create a mapper in R ? In what situations are mappers used (your role in functional programming)?
asked by 03.01.2019 / 02:48
1
answer

Continue to execute the loop even if a passage gives a problem

I am downloading the Bovespa stock data for the quantmod package. However, I still do not know why, in the data from Santander (SANB11) the getSymbols function of the package is giving problem and the loop for execution. Is ther...
asked by 20.02.2014 / 00:31