similar to: Recoding

Displaying 20 results from an estimated 6000 matches similar to: "Recoding"

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 ->
2012 Jul 24
3
package memisc: recode examples
Dear people, Yesterday I looked at the recode command in the memisc package and ran the following example stated in the manual: x <- as.item(sample(1:6,20,replace=TRUE), labels=c( a=1, b=2, c=3, d=4, e=5, f=6)) print(x) f <- as.factor(x) f recode(f,
2008 Mar 13
2
recover masked functions?
Hi, I have loaded the packages car, memisc, Hmisc and all of these implement the function recode. The order in which the packages are loaded depends on the order I execute my scripts and thus is not always the same and the syntax of the recode function changes with the package. Is there any way to call specificly the memisc recode function? Or maybe it's better to detach all packages first
2009 Apr 01
4
Recode of text variables
Hi all I am trying to do a simple recode which I am stumbling on. I figure there must be any easy way but haven't come across it. Given data of A","B","C","D","E","A" it would be nice to recode this into say three categories ie A and B becomes "Treat1", C becomes "Treat 2" and E becomes "Treat 3". I tried
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 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 <-
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****
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
2008 Jan 27
2
[OT] Open source archive program on windows
I am looking for a recommendation for an open source competitor to Winzip. I seem to recall Brian Ripley mentioning one in the last year or so, but couldn't find it in the mail archives. (Searching on Ripley there is somehow not terribly useful.) Suggestions? David Scott _________________________________________________________________ David Scott Department of Statistics, Tamaki Campus
2010 Apr 07
2
recoding variables-recode not working
Hi, I have numerical variable that I want to recode into categories '0' and '1 and more' and do analysis with that data. I have tried various of possibilities to do so, but I am sucked and nothing is working. recode(Q12, "0='A';1:30='B'") cut(Q12, breaks=c(0,1,30), lables=c('0', '1 and more')) cat(Q12, "0=0;1-33=1") What should
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
2010 Jan 28
1
Recoding Variables in R
VAR 980490 Some people have suggested placing new limits on foreign imports in order to protect American jobs. Others say that such limits would raise consumer prices and hurt American exports. Do you FAVOR or OPPOSE placing new limits on imports, or haven't you thought much about this? 1. Favor 5. Oppose 8. DK 9. NA; RF 0. Haven't thought much about this I am trying to
2008 Mar 27
1
Recode factors
I know this comes up, but I didn't see my exact issue in the archives. I have variables in a dataframe that need to be recoded. Here is what I'm dealing with I have a factor called aa > class(aa) [1] "factor" > table(aa) aa * 0 1 2 3 A B C D L N T 0 0 1908 725 2089 0 0 67 0 0 2 1 6 I need to recode
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
2006 Jul 02
2
how to recode in my dataset?
Dear Rusers, My question is about "recode variables". First, i'd like to say something about the idea of recoding: My dataset have three variables:type,soiltem and airtem,which means grass type, soil temperature and air temperature. As we all known, the change of air temperature is greater than soil temperature,so the values in those two different temperaturemay represent different
2011 Feb 18
3
recoding a data in different way: please help
Dear R users The following question looks simple but I have spend alot of time to solve it. I would highly appeciate your help. I have following dataset from family dataset : Here we have individuals and their two parents and their marker scores (marker1, marker2,....and so on). 0 means that their parent information not available. Individual Parent1 Parent2 mark1 mark2 1 0 0
2007 May 28
2
RODBC and Date/Time variables
This is really a query about MySQL which I am trying to use to set up a database which I will then access with RODBC. I have my data in a .csv file, and some of the fields are date/time fields. I tried to create a table using mysql with the definition of the date/time field given by CallDate DATETIME, but I got an error saying that the first row has 28/07/2006 0:00 in that field. What I
2008 Feb 11
4
R programming style
I am aware of one (unofficial) guide to style for R programming: http://www1.maths.lth.se/help/R/RCC/ from Henrik Bengtsson. Can anyone provide further pointers to good style? Views on Bengtsson's ideas would interest me as well. David Scott _________________________________________________________________ David Scott Department of Statistics, Tamaki Campus The University of Auckland,
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
2008 Mar 20
2
Cygwin and Rtools
I have just got a new machine and had a basic cygwin installed before it was given to me. It didn't include make. Previously I have installed Rtools to build packages and now I have got myself a bit confused as to whether to just install make from the cygwin packages or to install rtools. I would welcome any advice. I had a look at the rtools section in the Administration Manual and the