Questions tagged as 'r'

4
answers

Create column with sum and percentage of the maximum of other columns

I am a beginner in the R language and wanted to know how I would create a mutate function that would create a new column in my table and at the same time store in that new column the sum of the values contained in the other 6 columns of my table...
asked by 13.02.2017 / 14:35
2
answers

Application of the assign function in loops

I want to assign names to variables with a loop. With for I get: library(tidyverse) for(i in 1:6){ names<-str_c('var',i) assign(names,runif(30,20,100)) } But with lapply and map not: lapply lapply(1:...
asked by 14.12.2018 / 19:25
3
answers

How can I restructure information contained in a list object in two columns?

Considering a list x consisting of% with% vectors. To illustrate the problem I have thought that it has 3 elements, as follows: >x $'2751006' [1] 106.2 75.4 65.4 87.4 76.8 196.4 74.2 $'2751007' [1] 73.9 110.1 101.3 $'2752006'...
asked by 04.01.2016 / 20:30
1
answer

How to resolve the java.lang.NoClassDefFoundError error when running rhinit () on R

I am integrating Hadoop with R using Rhipe and my configuration is as follows: Ubuntu 14. Hadoop 1.0.3 R 3.2.2 Rhipe 0.73.1 When you start in the environment R o rhinit() the following message appe...
asked by 18.01.2016 / 21:20
1
answer

How to declare constants in R

When I was playing the example of the " How to transform a string in Date format in R? " the command tab<-readHTMLTable(u,header=T,skip.rows=1) failed. The error happened because in my environment it is natural to assign the T val...
asked by 06.03.2014 / 15:46
2
answers

Delete rows containing NA in a data frame

I have a date frame and in the fourth column there are several NA cells. I would like to know how I can delete all lines that have NA. I used this command but they keep showing up dataframe1 r <- with(dataframe1, which(dataframe1[4]==NA, ar...
asked by 28.05.2014 / 00:51
2
answers

How to import data from excel pro R?

I have a table in excel that I need to import into R. I was able to do this quietly with the read.csv function when the table in question was online, but I'm having trouble importing the file directly from my computer. As the code I'm doing will...
asked by 04.06.2014 / 06:26
3
answers

How to separate a string from a certain row in a data.frame and at the same time create more rows?

I have a data.frame with a column with strings of type "123-235-203". For example, the line:    string column1 column2   123-235-203 x and I want to separate this string, so that the line containing it will multiply preserving the va...
asked by 30.04.2015 / 02:00
2
answers

PDF for text arranging the columns

I am doing scraping to extract .pdf files, and I need these files as an organized text, since for each line of text of the file there are 3 different columns. For example in this file, you can see the 3 columns in question. I can read...
asked by 24.04.2017 / 21:30
1
answer

Computational efficiency in R - lists or vectors

I'm studying computational efficiency in R, generating matrices through different methods. First, I generate an array of vector form and calculate the variances for its columns: matriz <- matrix(rep(NA, 1000*200), nrow = 1000, ncol=200)...
asked by 10.03.2018 / 04:04