similar to: SAS-like method of recoding variables?

Displaying 20 results from an estimated 10000 matches similar to: "SAS-like method of recoding variables?"

2004 Jul 03
3
Recoding scores of negatively worded item
Hi, I'm new to R so please fogive if I write someting silly ... I need to recode a series of responses from a number of questionnaires. The data is read via ODBC from a database where all responses are coded as tables of the form (id, question, score). After dealing with recoding of missing values, I need to "invert" the scores of some questionnaire's item in the form x <-
2005 Jan 19
2
recoding large number of categories (select in SAS)
Hi, I have data on stomach contents. Possible prey species are in the hundreds, so a list of prey codes has been in used in many labs doing this kind of work. When comes time to do analyses on these data one often wants to regroup prey in broader categories, especially for rare prey. In SAS you can nest a large number of "if-else", or do this more cleanly with "select"
2023 Nov 18
1
combine barchart and xyplot in lattice
In below graph, I would like to add two vertical lines using panel.abline(). ?Is this possible? Thanks, Naresh mydf <- data.frame(hour = rep(6:20, 2), traffic = c(round(dnorm(6:20, 9, 3) * 10000), round(dnorm(6:20, 17, 4) * 10000)), direction = rep(c("inbound", "outbound"), c(15, 15))) vehicles <- data.frame(hour = 6:20, count = c(100, 120, 140, 125, 105, 80, 70, 75,
2023 Nov 18
1
combine barchart and xyplot in lattice
On Sat, 18 Nov 2023 at 06:44, Naresh Gurbuxani <naresh_gurbuxani at hotmail.com> wrote: > > In below graph, I would like to add two vertical lines using > panel.abline(). Is this possible? I assume you want the 'v' variable in panel.abline() to be interpreted in the context of your x-axis, which here represents a factor variable. Unless two factor variables have the same
2011 Jun 06
2
qplot fill and colour not working as expected
I am just learning to use qplot and can't get the fill/colour to work. Below is the R code for a scatter plot and bar graph. library(ggplot2) x<-c(1,2,3,4,5,6,7) y<-c(1,2,3,2,5,6,3) qplot(x,y, main="Scatter Plot Test", xlab="X Label Test", ylab="Y Label Test", colour="blue")z<-c("van", "van", "van",
2011 Aug 11
1
help with loops
hi I need help with list object. I have a list object > a <- c('apple','orange','grape') > b <- c('car','truck','jeep') > c <- list(a,b) > names(c) <- c('fruit','vehicle') > c $fruit [1] "apple" "orange" "grape" $vehicle [1] "car" "truck"
2011 Feb 19
1
Conditional recoding
I am trying to recode a variable into another variable and while the package 'car' works well when it is only recoding A into B, I am not sure I can do the same with recoding (A or C) into B. If i can use recode please advise on how to. So i am using an if/else if conditions. My sample dataset is below along with the code and the warning and results i get. TIA Krishnan #****Code****
2007 Jun 11
1
Recoding
I want to do some recoding of variables: code Age into groups and recode a factor into a smaller number of levels. There are a couple of options for recode functions, in the car package and in memisc, and I think in gmisc. Does anyone have any opinions on the the easiest, most reliable approach for these problems? David Scott _________________________________________________________________
2012 Nov 15
3
Can you have a by variable in Lag function as in SAS
Hello, I want to use lag on a time variable but I have to take date into consideration ie I don't want days to overlap ie: I don't want my first time of today to match my last time of yeterday. In SAS I would use : data x; set y; by date tim; previous=lag(tim); if first.date then do; previous=.; end; run; How can I do something similar in R? I can't find
2009 Aug 08
1
A problem with recoding agents calls via monitor
Hello everyone, I can not get the name of the recoding file of agents calls. I set agents.conf as following: ; Enable recording calls addressed to agents. It's turned off by default. recordagentcalls=yes ; ; The format to be used to record the calls (wav, gsm, wav49) ; By default its "wav". ;recordformat=gsm ; ; Insert into CDR userfield a name of the the created recording ; By
2005 Aug 23
1
Seeking help with an apparently simple recoding problem
Hello, I have struggled, for longer than I care to admit, with this seemingly simple problem, but I cannot find a solution other than the use of long drawn out ifelse statements. I know there has to be a better way. Here is stripped down version of the situation: I start with: a <- c(1,0,1,0,0,0,0) b <- c(1,1,1,1,0,0,0) c <- c(1,1,0,1,0,0,0) rbind(a,b,c) [,1] [,2] [,3] [,4] [,5]
2004 Oct 18
2
Recoding factors
I'm having a bit of trouble recoding factors in a fields. I have a field which has the factors Singleton, Twin and Triplet. I want to recode the field to have only the factors Singleton and Multiple. Any advice? Cheers, Neil
2001 Mar 27
4
recode vector values to NA
Greetings, I'm in the painful process of migrating from SAS to R. In the process I've discovered that there are some basic things that I am getting hung up on. The most basic is the simple recoding of variables. Suppose I create a vector x <- rnorm(10000) and I want to recode all values of x > 1.5 to NA. How would I do that in R? TIA Cheers, Patrick
2011 Sep 01
2
Automatic Recoding
I have a text file full of numbers (it's a edgelist for a graph) and I would like to recode the numbers as they are way too big to work with. So for instance the following: 676529098667 1000198767829 676529098667 100867672856227 676529098667 91098726278 676529098667 98928373 1092837363526 716172829 would become: 0 1 0 2 0 3 0 4 5 6 i.e. all 676529098667 would become
2006 Jun 23
1
numeric variables converted to character when recoding missing values
Dear R helpers, I have a data frame where missing values for numeric variables are coded as 999. I want to recode those as NAs. The following only partially succeeds because numeric variables are converted to character in the process: df <- data.frame(a=c(999,1,999,2), b=LETTERS[1:4]) is.na(df[2,1]) <- TRUE df a b 1 999 A 2 NA B 3 999 C 4 2 D is.numeric(df$a) [1] TRUE
2010 Apr 23
3
Event History Data Recoding
Dear R list, I have an event history data set that is structured like this: Legislative act Discussion Agreement Time Event Act1 2006-05-30 2006-06-19 20 1 Act2 2004-03-01 2004-06-14 105 1 . . . I have information on the meetings in the legislature between adoption periods in a separate variable (the
2005 Sep 29
2
Hardware Specifications
Does anyone know where i can find out how powerful a machine has to be to handle a certain amount of call volume? Eg, 2Ghz is enough processing power to maintain 100 calls at a time. 4Ghz is engouh to process 250 calls etc etc. Thanks Dan -------------- next part -------------- An HTML attachment was scrubbed... URL:
2019 Oct 04
1
CentOS 8 network-scripts
On Fri, 4 Oct 2019 at 10:41, Valeri Galtsev <galtsev at kicp.uchicago.edu> wrote: > > > > On 2019-10-04 08:03, Chris Adams wrote: > > Once upon a time, Ljubomir Ljubojevic <centos at plnet.rs> said: > >> Bridge for VM's is main reason I hate NM. > > +1 > > My impression is younger generation doesn't value rules that programmers > were
2008 May 19
2
recoding data with loops
# I'm new to R and am trying to get the hang of how it handles # dataframes & loops. If anyone can help me with some simple tasks, # I'd be much obliged. # First, i'd like to generate some random data in a dataframe # to efficiently illustrate what I'm up to. # let's say I have six variables as listed below (I really # have hundreds, but a few will illustrate the point). #
2010 Nov 03
1
Recoding -- test whether number begins with a certain number
Dear R community, I have a question concerning recoding of a variable. I have a data set in which there is a variable devoted to the ISCO code describing the occupation of this certain individual (http://www.ilo.org/public/english/bureau/stat/isco/isco88/major.htm). Every type of occupation begins with a number and every number added to this number describes th occupation more detailed. Now my