search for: col_nam

Displaying 19 results from an estimated 19 matches for "col_nam".

Did you mean: col_name
2012 May 21
3
Replace a variable by its value
I have a dataset called "raw-data" . I am trying to use the following code - col_name<-names(raw_data) for (i in 1:(length(names(raw_data))-2)) { tbl=table(raw_data$Pay.Late.Dummy, raw_data$col_name[i]) chisqtest<-chisq.test(tbl) } Say the 1st column of my raw_data is Column1. The idea is when i=1 then raw_data$col_name[i] will automatically become raw_data$Column1 ,...
2009 Apr 09
2
how to automatically select certain columns using for loop in dataframe
...rn", "Bolton", "Bravo", NA), NUM_C = 1:5, NAME_C = c("Candy", NA, "Cecil", "Crayon", "Corey"), NUM_D = 1:5, NAME_D = c("David", "Delta", NA, NA, "Dummy") ) col_names <- c("A", "B", "C", "D") > all.data NUM_A NAME_A NUM_B NAME_B NUM_C NAME_C NUM_D NAME_D 1 1 Andy 1 <NA> 1 Candy 1 David 2 2 Andrew 2 Barn 2 <NA> 2 Delta 3 3 Angus 3 Bolton 3 Cecil...
2017 Jul 20
2
dynamically create columns using a function
..._SET_NAME", "YLD_BE_REG1", "YLD_BE_REG2", "IS_GG"), class = "data.frame", row.names = c(NA, -6L)) # function demo_fn demo_fn<- function (dat, blup_datacut = c("REG1", "REG2")) { for (i in seq_along(blup_datacut)) { col_name_gg <- paste("GG", blup_datacut[i], sep = "_") col_mean_gg <- paste("YLD_BE", blup_datacut[i], sep = "_") dat2 <- calc_gg(dataset = dat, col = col_mean_gg, col_name = col_name_gg) } dat2 } # function calc_gg Calc_gg&lt...
2017 Jul 21
0
dynamically create columns using a function
..., "IS_GG"), class = "data.frame", row.names = c(NA, -6L)) demo_fn<- function (data, f, names) { for (i in names) { data <- f(data, i) } data } f <- function(data, name) { col_work <- paste("YLD_BE", name, sep = "_") col_name_result <- paste("GG", name, sep = "_") #do something interesting, here I am simply copying the column data[col_name_result] <- data[col_work] data } demo_fn(dem, f, c("REG1", "REG2")) If you are working with large datasets it might not...
2007 Aug 13
0
about REALTIME application
...s a replacement using application REALTIME. I found that it is very troublesome to use it. ---------from web site--------- Set(row="${REALTIME(sipusers,callerid,${EXTEN})}"); //executing SELECT * FROM <sipusers>* WHERE callerid=${EXTEN} into variable $row NoOp(${row}); Set(col_name_pair=${CUT(row,"|",1)}); NoOp(${col_name_pair}); //col_name_pair become: name=mysipuser Set(col_name=${CUT(col_name_pair,"=",2)}); NoOp(${col_name}); //col_name become: mysipuser (and that's what we want) ------------------------------------ As you can see, we need...
2017 Nov 17
3
Dataframe is character
...le as binary?) > library(readxl) > library(readxl) > library(metafor) > setwd("C:/docs/Work2/Statistic_Analyses/MetaQTcAD") > getwd() [1] "C:/docs/Work2/Statistic_Analyses/MetaQTcAD" > > dat <- read_excel("Hedges-g_QTc MA_R05.xlsx", sheet = 2, col_names=TRUE, col_types = c("guess")) > class("dat") [1] "character" > class("yi") [1] "character" > [[alternative HTML version deleted]]
2017 Sep 14
1
Print All Warnings that Occurr in All Parallel Nodes
...lose(con) # C) Import Zipped CSV data into List of Dataframes, which latter on are compiled as a single dataframe by # means of rbind # C.1) parRapply Function Initialization: parRaplly_Function <- function (DISPOIN_CSV_Row) { return(read_csv2( file = DISPOIN_CSV_Row, col_names = c( "SCADA", "TAG", "ID_del_AEG", "Descripcion", "Time_ON", "Time_OFF", "Delta_Time", "Comentario", "Es_Alarma", "Es_Ulti...
2018 Jan 15
0
sum multiple csv files
...n. This would require that you convert the data frames read in by read.csv into matrices before adding them: All_data <- lapply(filenames ,function(i){ ###read cvs files and add the row and column names to each data frame ### as.matrix( read.csv(i, header=FALSE, sep = "", col.names = col_names, row.names = row_names) }) result <- Reduce( `+`, All_data ) This will fail if any of the values in your csv files are non-numeric, but dealing with that would require us to know specifics about your files or intent that you have omitted. (The dput function is indispensable for clarifying su...
2018 Jan 15
4
sum multiple csv files
...ned all the cvs files into a large list, and I created two filenames <- list.files('data',full.names=TRUE) All_data <- lapply(filenames,function(i){ ###read cvs files and add the row and column names to each data frame### read.csv(i, header=FALSE, sep = "", col.names = col_names, row.names = row_names) }) However I would like to sum the rows of cvs files to get a single data frame (each cvs file has 47 rows and colunms, so the final data frame should have the same). I could only do it one by one data data frame, but I was wondering if anyone could give an idea of how t...
2014 Apr 24
0
How to make optgroup with rails version 3
...ay of doing this how i have it? right now if you take the raw section and just have data.collect {|a| [ a.name, a.id ] } instead, it works great for just showing the names of the users, but i want to add that optgorup. How would i go about doing that? = f.select "#{available_filter_option.col_names}", [raw("<optgroup label='Active Users'><option> " + data.collect {|a| [ a.name, a.id ] } + " </option></optgroup>")], {:include_blank => ' '}, class: 'closed_filters', filter: available_filter_option....
2017 Nov 17
0
Dataframe is character
...; > library(readxl) > > library(metafor) > > setwd("C:/docs/Work2/Statistic_Analyses/MetaQTcAD") > > getwd() > [1] "C:/docs/Work2/Statistic_Analyses/MetaQTcAD" > > > > > dat <- read_excel("Hedges-g_QTc MA_R05.xlsx", sheet = 2, col_names=TRUE, > col_types = c("guess")) > > class("dat") > [1] "character" > > class("yi") > [1] "character" > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-h...
2016 Jul 09
2
Red Neuronal complicada categorías
...atrix(~ factor(x$V4) - 1) V5Binario <- model.matrix(~ factor(x$V5) - 1) V6Binario <- model.matrix(~ factor(x$V6) - 1) x_new <- cbind(V1Binario,V2Binario) x_new <- cbind(x_new,V3Binario) x_new <- cbind(x_new,V4Binario) x_new <- cbind(x_new,V5Binario) nam_ori <- colnames(x_new) col_nam <- paste("V", 1:ncol(x_new), sep = "") colnames(x_new) <- col_nam library(RSNNS) xValues <- x_new xTargets <- x[, 6] xTargetsDecoded <- decodeClassLabels(xTargets) x_nn <- splitForTrainingAndTest(xValues, xTargetsDecoded, ratio=0.15) set.seed(432) model <...
2017 Aug 27
1
In Ops.factor(...) not meaningful for factors
...fset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases In addition: Warning message : In Ops.factor(diff(sample_bank[, 4]), sample_bank[, 4][-length(sample_bank[, : ?/??not meaningful for factors ( how to change type of columns that it works well?) ?colnames(ab_ret) <- as.character(col_nam) Error in `colnames<-`(`*tmp*`, value = character(0)) : attempt to set colnames on an object with less than two dimensions If there are not enough information.. To load the files available at this URL: https://drive.google.com/open?id=0BxDK2ohAcqDMN0Vpb1g0U2pCczQ I tried to find answers on stac...
2016 Apr 27
0
R Script Template
The subject of your email is missing. Perhaps you need to read the Posting Guide (again?) about attachments. Embedding your example directly in the body of the email is generally more accessible in archives than attaching it. -- Sent from my phone. Please excuse my brevity. On April 27, 2016 1:14:17 PM GMT+01:00, G.Maubach at gmx.de wrote: >Hi All, > >I am addressing this post to all
2016 Apr 27
2
R Script Template
Hi All, I am addressing this post to all who are new to R. When learing R in the last weeks I took some notes for myself to have code snippets ready for the data analysis process. I put these snippets together as a script template for future use. Almost all of the given command prototypes are tested. The template script contains snippets for best practices and leaves out the commands that
2016 Jul 07
2
Red Neuronal complicada categorías
Estimados Les consulto por redes neuronales, hay diversos artículos como los siguientes (el último tienen un error actualmente). Pero mi pregunta va un poco por otro lado. http://www.r-bloggers.com/build-your-own-neural-network-classifier-in-r/ http://www.r-bloggers.com/classification-using-neural-net-in-r/ Básicamente se puede calcular un valor, por ejemplo doblar 2,4 grados a la derecha, luego 1
2006 Jul 18
3
DB Migrations & Column Order
...ys that there is an options parameter for add_column, but I couldn''t really find much information on it. I could, of course, manually write the SQL, but I want to see if there is a way to do this built-in to add_column(). The syntax would be: ADD [COLUMN] column_definition [FIRST | AFTER col_name ] So I tried: add_column :memberships, :id, :integer, :first => true There was no error, but it did not put it first. Is it possible to do this? I know it doesn''t really matter, but it bothers me...Thanks! Michael
2017 Oct 05
1
dealing with a messy dataset
dear Jim, Yes I fixed the problem. Thanks again all of you for your contribution! This worked : start <- c(1, 20, 35, 41, 44, 48, 53, 59, 64, 70, 76, 78, 83, 88, + 93, 114, 122, 127) data1<-read_fwf("lvg_table2.txt",skip=70, fwf_widths(diff(start))) Well now I know how to deal with fixed-width files :) Cheers Jean-Philippe On 05/10/2017 18:42, jim
2010 Apr 15
4
Does "sink" stand for anything?
Hello Everyone,   Learning about R and its wonderful array of functions. If it's not obvious, I usually try to find out what a function stands for. I think this helps me remember better.   One function that has me stumped is "sink." Can anyone tell me if this stands for something?   Thanks,   Paul         __________________________________________________ [[alternative HTML