similar to: R Function to extract columnNames

Displaying 20 results from an estimated 900 matches similar to: "R Function to extract columnNames"

2015 Oct 08
1
Tranformar falsas variables char en numéricas
Hola, Una manera muy sencilla de hacerlo es esta: #------------------------------- whatcol <- 0 for(i in 1:ncol(d)){ whatcol[i] <-class(d[,i]) } whatcol #-------------------------------- > whatcol <- 0 > for(i in 1:ncol(d)){ + whatcol[i] <-class(d[,i]) + } > whatcol [1] "character" "character" "factor" "factor"
2012 Oct 04
4
Subsetting a group of data
Hi, I am making my way down the learning curve of R, and find it a great language with so many helpful users! Below is an example of what I'm trying to do, but can't quite figure out the right path to go down. Here's what I have: Main is a time series of data with columns Cola and Colb Cola Colb 1 1 1 2 1
2008 Jun 27
2
change values in data frames
Hello every body, I am quite a new user of R so I beg your pardon for this naive question and the lake of syntax with wich I ask it: I have a data frames like this: cola colb 1 c 1 i 1 i 1 c 2 i 2 c 2 c 2 i 2 i ... 10000 I would like ,for each level of cola and for x in colb: -if colb[x]=="i" and colb[x-1] does not exist (first row in dataframes), then replace colb[x] by
2012 Jul 11
4
Help with loop
Hi, I have two dataframes: The first, df1, contains some missing data: cola colb colc cold cole 1 NA 5 9 NA 17 2 NA 6 NA 14 NA 3 3 NA 11 15 19 4 4 8 12 NA 20 The second, df2, contains the following: cola colb colc cold cole 1 1.4 0.8 0.02 1.6 0.6 I'm wanting all missing data in df1$cola to be replaced by the value of df2$cola.
2009 Jul 12
2
Nonlinear Least Squares nls() programming help
Hi, I am trying to use the nls() function to closely approximate a vector of values, colC and I'm running into trouble. I am not sure how if I am asking the program to do what I think its doing, because the same minimization in Excel's Solver does not run into problems. If anyone can tell me what is going wrong, and why I'm getting a singular convergence(7) error, please tell me. I
2011 Aug 03
2
Error message for MCC
Greetings all, I am getting an error message that is stifling me. Any ideas? > ## Define Directories ## > load_from <- "/home/mcc/Dropbox/abrodsky/kegg_combine_data/" > save_to <- "/home/mcc/Dropbox/abrodsky/ttest_results/" > > ############################### > ## Define Columns To Compare ## > compareA <- "log_b_rich" > compareB
2005 Sep 09
3
how to do something like " subset(mat, ("col1">4 & "col2">4)) "
Dear all, I have a problem with the "subset()" function. I spent all day yesterday with a collegue to solve it and we did not find a satisfying solution (even in the archived mails), so I ask for your help. Let's say (for a simple example) a matrix mat: R> mat cola colb colc [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 My goal is to select the lines of the matrix on the basis of the
2011 Jun 10
2
Sorting Data Frame Without Loop
Hello all! I am currently trying to sort a data frame in a particular way, but I am having some difficulties with this. Specifically I want to sort the below dataset in such a way that there is only one line per ProteinID and if there are multiple GeneID or GeneName entries for a single proteinID, that they be concatenated with a comma separating them. The way I have done it earlier worked fine
2011 Aug 05
2
Which is more efficient?
Greetings all, I am curious to know if either of these two sets of code is more efficient? Example1: ## t-test ## colA <- temp [ , j ] colB <- temp [ , k ] ttr <- t.test ( colA, colB, var.equal=TRUE) tt_pvalue [ i ] <- ttr$p.value or Example2: tt_pvalue [ i ] <- t.test ( temp[ , j ], temp[ , k ], var.equal=TRUE) ------------- I have three loops, i, j, k. One to test the all of
2010 Feb 10
2
sum sections of data of different lengths from within a data frame
Dear R Help: I am trying to sum data from one column in a dataframe based on a value in another. I do not know how to do this easily in R. For example: Col A Col B 1 0 3 0 2 1 2 0 1 0 4 0 1 1 9 1 3 0 5 0 2 1 I would like to cumsum the values in Col A for all rows where Col B is 0, and a value of 1 in Col B will reset
2013 Apr 03
2
Creating data frame from individual files
Dear Group: I have 72 files (.txt). Each file has 2 columns and column 1 is always identical for all 70 files. Each file has 90,799 rows and is standard across all files. I want to create a matrix 40(rows) x 70 columns. I tried : temp = list.files(pattern="*.txt") named.list <- lapply(temp, read.delim) library(data.table) files.matrix <-rbindlist(named.list) >
2010 Dec 09
2
Reshape Columns
Hello, I have a general formatting question. I have two columns of data: ColA <- c("m", "m", "m", "m") ColB<- c("d","d","d","d") And I would like to reorder them into a new column that looks like this: ColC<-
2010 Jul 16
2
a issue about the qutation mark?
Following is a function that I wrote (It is working well). It's a simple one, nothing complicated. The only question that I have is a qutation mark issue, I guess. ############################################# funcname <- function(trait.file){ #line1 setwd('/root/subroot') # line 2 load('imge.RData')
2016 Jul 28
2
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
I needed to be able to update stub pointers for hot functions that get recompiled in a lazy JIT that uses CompileOnDemandLayer. In order to do this I added a method that allows pointers to be updated but does not expose any of the other internals of the COD layer. Does anyone have a cleaner way to do this? Has something to facilitate this already been added? Would it be possible to merge this
2013 Oct 19
2
[LLVMdev] An enhancement for MCJIT::getFunctionAddress
In MCJIT, the old JIT functions are deprecated in favor of getFunctionAddress. Code like: llvm::Function *F = M->getFunction(FuncName); void *FN = EE->getPointerToFunction(F); should be rewritten as uint64_t FN = EE->getFunctionAddress(FuncName); While functionally identical, in case the correct module is known the new version will be much slower, linear with the number of added
2002 May 02
2
General "moving" functions
General "moving" function. I'm a relatively new comer to R, and I've only just started writing my own R functions. However, I need some help for something which I'm sure is quite straight forward. I want to write a function that will allow me to calculate "moving results" for a given vector. Ideally, the function will be of the form foo<-function(vector1,
2020 Jul 22
3
samba-tool domain backup offline stalls
FreeBSD-12.1p7 jail running Samba-4.10.15 on ZFS. When I run 'samba-tool domain backup offline targetdir=/tmp' I see this: running backup on dirs: /var/db/samba4/private /var/db/samba4 /usr/local/etc Starting transaction on /var/db/samba4/private/secrets At which point samba-tool enters a permanent wait state. 86064 root 1 52 0 131M 78M wait 3 0:01 0.00%
2015 Oct 08
3
Tranformar falsas variables char en numéricas
Hola usuarios de R, Antes de nada presentarme, soy nuevo en R (antiguo... y bueno actual usuario de SAS), llevo menos de un mes y estoy intentando empezar con pequeñas cosas. Hay un tema que me está llevando bastante tiempo y por más que investigo y hago pruebas no logro saber como se hace; veréis tengo un data.frame el cuál tiene bastante variables y todas ellas clasificadas como char, sin
2016 Jul 29
0
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
+Lang Hames <lhames at gmail.com>, Master Regent of the Three <No, Two sir> JITs On Thu, Jul 28, 2016 at 12:31 PM Sean Ogden via llvm-dev < llvm-dev at lists.llvm.org> wrote: > I needed to be able to update stub pointers for hot functions that get > recompiled in a lazy JIT that uses CompileOnDemandLayer. In order to do > this I added a method that allows pointers to
2013 Dec 19
1
Re: About debugging of libvirt.
i did the debugging as you said. Kindly refer the following logs: (gdb) c Continuing. thread apply all bt [New Thread 0x7fc337c6b700 (LWP 29520)] Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) thread apply all bt Thread 12 (Thread 0x7fc337c6b700 (LWP 29520)): #0 0x00007fc33509f18d in read () from /lib/x86_64-linux-gnu/libpthread.so.0 #1