Re: [R] Filtering an Entire Dataset based on Several Conditions

2022-05-09 Thread Jim Lemon
Hi Paul, Based on my guess that all values have been normalized, I would say: mat<-(matrix(runif(16,-5,5),4)) df<-as.data.frame(mat) df[abs(df) < 3]<-NA df V1 V2 V3V4 1 NA 4.675699 3.166625NA 2 NA NA NA 3.463660 3 4.288831 NA

Re: [R] Filtering an Entire Dataset based on Several Conditions

2022-05-09 Thread Rui Barradas
Hello, Something like this? First normalize the data. Then a apply loop creates a logical matrix giving which numbers are in the range -3 to 3. If they are all TRUE then their sum by rows is equal to the number of columns. This creates a logical index i. Use that index i to subset the scaled

[R] Filtering an Entire Dataset based on Several Conditions

2022-05-09 Thread Paul Bernal
Dear friends, I have a dataframe which every single (i,j) entry (i standing for ith row, j for jth column) has been normalized (converted to z-scores). Now I want to filter or subset the dataframe so that I only end up with a a dataframe containing only entries greater than -3 or less than 3.

Re: [R] Filtering an Entire Dataset based on Several Conditions

2022-05-09 Thread Rui Barradas
Hello, My code seems to work with your data, except that the first column is not to be scaled. # file names xlsfile <- file.path("~/dados", "trainFeatures42k.xls") csvfile <- file.path("~/dados", "Normalized_Data.csv") # read in the data files df1 <- readxl::read_excel(xlsfile, col_names =

Re: [R] Filtering an Entire Dataset based on Several Conditions

2022-05-09 Thread Bert Gunter
This is trivial, so perhaps there is a miscommunication. How do you want to handle values outside your desired range? I would simply change them to NA (see below), but perhaps you have something else in mind that you need to describe more explicitly. Anyway, below is a simple example of what I

[R] Contract work for non-linear regressions

2022-05-09 Thread Marlin Keith Cox
I am not sure if this is appropriate here, my apologies if not. I have used R for 20 years now and need help with non-linear regression analysis over 100's of different frequencies and my data has exceeded by R program capabilities. My company would provide the contract. keith M. Keith Cox,

Re: [R] Filtering an Entire Dataset based on Several Conditions

2022-05-09 Thread Avi Gross via R-help
Paul, I read through the public replies you received and clearly some of us were not too clear on what you asked. Your subject line was not helpful as my first thought was that you wanted a single column examined for two conditions, as in EITHER less than 3 standard deviations above the mean 

Re: [R-es] GRAFICO DE BARRAS

2022-05-09 Thread Jose Betancourt Bethencourt
NO ME RESULTÓ gRACIAS DE TODOS MODOS El 9/5/22, Juan Abasolo escribió: > Seguro que te lo saben resolver muchísimo más elegante. > Pero si te sirve para desatascarte, acá mi ejercicio > > Suerte > > library(tidyverse) > dtk <- read.csv('data/raw/presiones.csv', > sep = ',', dec

Re: [R-es] GRAFICO DE BARRAS

2022-05-09 Thread Jose Betancourt Bethencourt
ENVEZ DE SUM USÉ MEDIAN QUE ES LO QUE ME CONVIENE, GRACIAS!! library(readxl) ta <- read_excel("C:/Users/betan/Desktop/presiones.xlsx") attach(ta) ' ta %>% pivot_longer(cols = names(ta)) %>% group_by(name) %>% summarise(median(value)) %>% ungroup() %>% mutate( valor = `median(value)`)