Questions tagged as 'r'

1
answer

Standardize or normalize numerical variables of a base with a mixture of numerical and categorical variables

I have a database where numerical and categorical variables are mixed, I want to apply the scale () foundation to these variables efficiently, that is, that I do not have to create another dataframe with only numerics and apply the foundation sc...
asked by 12.10.2018 / 03:42
2
answers

Cut out a vector in several vectors

Be the following vector: x <- c(1, 2, "a", 2, 3, 4, "a", 3) I need to cut a vector in multiple vectors contained in a list, starting from an element of the same vector, in this case from "a" : [[1]] [1] 1 2 [[2]] [1] 2 3 4 [[3]...
asked by 11.09.2018 / 01:18
2
answers

Remove items from a list in R

I have a list that is made up of 1000 data.frame (replicas), where each of the data.frame consists of 16 rows and 22 columns And I want to create lists where: List 1: this is composed of the values of column 1 and row 1 of all t...
asked by 28.11.2017 / 18:07
2
answers

R: change the colors of a DCA

From this file: https://drive.google.com/open?id=1jmZG-nyt707AhHZSSl4dHLIxK0nZ5qyX and these packages library(vegan) library(reshape2) And taking this code to make this graph, I would like to know how I can change the co...
asked by 04.10.2018 / 16:38
1
answer

error when trying to include name to the second axis and using ggplot2

I'm trying to plot a chart with two "y" axes. I almost managed to finish it but I still do not know why I can not put a name to the second axis and. I enclose a fragment of my data so that it is better understood. The code I'm using is thi...
asked by 13.12.2018 / 12:34
1
answer

Problems with merge and dplyr

I am joining two data.frames huge by a common variable using merge , and the data.frame final% has many more lines than the initial ones, which suggests that you are duplicating observations. I'm using: df3 <- merge(df1, df2,...
asked by 26.06.2018 / 09:16
1
answer

Parallel 2 functions for 1 data.frame

I've been looking for information about parallelizing processes in R and I've been messing with the "parallel", "foreach" and "doParallel" packages but I have not got the results I wanted. I would like to be able to do 2 functions at the same ti...
asked by 16.08.2018 / 12:39
2
answers

Function and conditional

Good evening. I have two vectors, one with binary data M <- c(1, 0, 0, 1, 0, 0) and another with non-binary data C <- c(2.5, 3) I need to create a function (in R) that assigns a value of vector C, whenever a value o...
asked by 26.10.2017 / 00:41
3
answers

Loops nested in R

I have 3 dataframes that contain the following information: df1 COD LON LAT ALT C037 -289.976 432.165 162 E000 -274.107 430.783 218 C068 -228.623 428.395 596 df2 #So many data by COD as dates (which...
asked by 15.05.2018 / 10:50
1
answer

Replace rows according to criteria

I would like to find a simpler way to make this script.  I have a dataframe: ClearDatos<-Datraframe species level: Site Date Habitat Season Year Taxa Q1F 08_09_2015 Oak Autumn 2015-2016 Adonis_flammea...
asked by 15.11.2017 / 20:38