similar to: better way of recoding factors in data frame?

Displaying 20 results from an estimated 100 matches similar to: "better way of recoding factors in data frame?"

2006 Nov 01
1
How to rsync only specified subdirectories in the source folder?
Hi all, For example,if there is ten subdirectories named sub1~sub10(each including subdirectories and files too),and file1~file10,how can I rsync only sub2 and sub 3 to the target? /---- MyFolder |---------- sub1 |---------- sub2 |---------- sub3 |---------- sub4 |---------- sub5 |---------- sub6 |---------- sub7 |---------- sub8 |---------- sub9
2012 Oct 25
2
mean of a value of the last 2 hours
Hello, I have a data frame somewhat like that: myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert", "Bert", "Bert"), Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00"), Hunger=c(1,1,1,2,2,1) ) myframestime <- as.POSIXct (strptime(as.character(myframe$Timestamp),
2012 Nov 27
5
loop with date
Hello, I tried to construct my very first loop today and completly failed :-( Maybe someone can help me? I have a dataframe somewhat like this one: myframe <- data.frame (Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00", "25.09.2012 09:00", "25.09.2012 10:00", "25.09.2012
2002 Sep 09
1
multiple "keys" in Trellis plots?
My xyplot has a number of panels, and I'd like a separate key for each rather than a single key for the entire set. However, I cannot find a way to pass multiple key definitions to xyplot's "key" argument. Allow me to throw out a simple example: require(methods) require(lattice) ## define sample data myFrame1 <- data.frame(a=1:100, b=rep(1:10,10), c=unlist(lapply(1:10, rep,
2012 Dec 17
2
calculate a "rolling mean" including standard deviation
Hello everyone, I have a data frame somewhat like this one: myframe <- data.frame (Timestamp=c( "24.09.2012 06:00", "24.09.2012 07:00", "24.09.2012 08:00", "24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00", "24.09.2012 12:00",
2009 Nov 27
2
using reshape to do ANOVA mixed models
Hi, I just started with R and I found that there are many options to rearrange the data to do mixed models. I want to use the reshape function. I have 2 between subject variables and one within. I was able to change the data structure but still - the result of the aov functions are calculating everything as a within subject. the table looks like this: SerialNo breed treatment distance_1
2012 Oct 26
0
mean of a value of the last 2 hours using plyr (Thank you)
Hi dear three helpers, Thanks a lot! Your solutions worked great. Again I learned a lot. Tagmarie Am 25.10.2012 18:36, schrieb Felipe Carrillo: > Another option using plyr, > library(plyr) > myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert", "Bert", > "Bert"), Timestamp=c("24.09.2012 09:00",
2012 Dec 07
0
apply a function at: dateX, dateX+1, dateX+2, ....
Dear knowing people, Dennis Murphy helped me a lot with my first loop last week. Thanks again - I could have made more than 10 "Thank-You cakes" in the time it saved me! But now I want to complicate the thing. My ideas didn't work. Let's see if anyone is smarter ;-) The following packages are needed: library(adehabitatHR) library(rgdal) library(plyr) # My dataframe looks
2013 Apr 26
0
[LLVMdev] 'LowerDbgDeclare' in Instruction combining affects scope information
Hi All,   For the test snippet below, int func(int dd, int ds, int *rm) {   int d_sn = 0;   int dv_sn = 0;   unsigned int d, r;   if (dd < 0) { d_sn = 1; dd = -dd; };   if (ds < 0) { dv_sn = 1; ds = -ds ; };     d = func1( dd, ds, &r);     if (d_sn && dv_sn){ r = -r;}   else if (d_sn) { d = -d; r = -r; }   else if (dv_sn) { d = -d; };     if (rm) { *rm = (signed int)r; }  
2009 Nov 23
1
xrcise not working
Hi. I''m back. Unfortunately I can''t get xrcise working. Here is the sample xrc file and the resulting error messages: =============== TestWxFb.xrc ========================================= <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
2003 Nov 05
0
Re: [S] LME - fixed effects model and missing values
Here is an answer to a 1999 post. I didn't find a direct answer anywhere on the Web, perhaps because it is "obvious" once one sees it. Suppose you have data from a longitudinal study, where each subject was measured *up to* four times, with missing measurements, so that the data look like this: > MAT<- structure(c(23, 24, 6, 19, 16, 20, 13, 11, NA, 8, NA, 21, 19, 15, 11,
2007 Nov 23
0
Mutual information
Dear R helpers, I have a data frame > summary(emPat) pairE subj pattern far-near : 18 sub1 : 37 urb :123 long-short : 18 sub2 : 37 bpb : 72 supported-unsupported: 18 sub3 : 37 prp : 67 large-small : 18 sub4 : 37 brb : 64 dense-sparse : 18 sub5 : 37 unp : 62
2011 Jul 17
0
[LLVMdev] Trying to optimize out store/load pair
Hello all, My app is using LLVM JIT as a runtime engine for image analysis (similar to opencl). I'm placing values into a struct to pass byref to a series of functions. After running the createStandardModulePasses(...) set of optimizations, the function calls are all inlined but the struct store/load pairs haven't been optimized away. I've attached the code below. What I'd like to
2011 Jul 17
0
[LLVMdev] Trying to optimize out store/load pair
Hello all, My app is using LLVM JIT as a runtime engine for image analysis (similar to opencl). I'm placing values into a struct to pass byref to a series of functions. After running the createStandardModulePasses(...) set of optimizations, the function calls are all inlined but the struct store/load pairs haven't been optimized away. I've attached the code below. What I'd like to
2016 Aug 23
2
How to describe the RegisterInfo?
Yes, the arch is just as you said, something like AMD GPU, but Intel GPU don't have separate register file for 'scalar/vector'. In fact my idea of defining the register tuples was borrowed from SIRegisterInfo.td in AMD GPU. But seems that AMD GPU mainly support i32/i64 register type, while Intel GPU also support byte/short register type. So I have to start defining the registers from
2012 Jul 15
0
[LLVMdev] Issue with Machine Verifier and earlyclobber
I think I'm getting a bit closer to the problem. I've found that the call to InlineSpiller::foldMemoryOperand() inside InlineSpiller::spillAroundUses() is causing the problems. As a test, I removed that call and with your yesterday's patch I'm not getting any errors at all, the code generated is the same one as with the call. This is happening when
2011 Jul 22
1
Recoding Multiple Variables in a Data Frame in One Step
Hi, I can't for the life of me find how to do this in base R, but I'd be surprised if it's not possible. I'm just trying to replace multiple columns at once in a data frame. #load example data data(api) #this displays the three columns and eight rows i'd like to replace apiclus1[ apiclus1$meals > 98 , c( "pcttest" , "api00" , "sch.wide" ) ]
2011 Feb 13
2
Recoding using the memisc package
Dear All, I am trying to recode a variable using the functions provided by "memisc" package. Actually I am following the examples on page 9-10 of the vignette: -------------------------------------------------------------------------- d.fig <- within(d.fig,{ sev <- recode(sev, 1 -> 0.9, 2 -> 1.0, 3 -> 1.1, 4 ->
2000 Oct 10
1
Adding a new column to data frame (recoding)
Dear R users, I have a very simple question. What is the easiest way to recode data in one of the columns of a data frame and put it into a new column? For example, here is a simple data frame: var1 1 1 2 2 3 3 How do I add a new column to data - 'var2' in which I group values in 'var1', for example: var1 var2 1 1 4 2 2 4 3 3 5 It's got to
2018 May 23
0
Recoding variables in R
Thank you all for your help, it worked! Op 23 mei 2018 om 19:27 heeft marta azores <martazores at gmail.com<mailto:martazores at gmail.com>> het volgende geschreven: Try that code NewDF<-DF[!DF$Anxiolytics==1,] 2018-05-23 10:14 GMT+00:00 Lisa van der Burgh <lisavdburgh at hotmail.com<mailto:lisavdburgh at hotmail.com>>: Hi all, I have a very general question and I