Displaying 20 results from an estimated 4000 matches similar to: "Seeking help with an apparently simple recoding problem"
2005 Aug 25
1
Attempting to recode elements contained in a list
Hello R-Masters,
I have a list 's' with three elements, as shown below. I want to recode a.a, a.a2, and a.a3 to NA if the value in a.a is less than 3.
I reivewed my Modern Applied Statistic Book, the online help and did some searching of R-help on the internet. I explored unlist and as.list.data.frame in an attempt to isolate the third element of the list s, but this was not helpful.
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
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
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 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 ->
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 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
_________________________________________________________________
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
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****
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).
#
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 Jul 23
1
FW: recoding problem
Hi,
I am trying to recode the output from a matrix(here is a small snippet of it):
HGlt10RawPerc2008[1:20]
[1] -5
0
-1
-1
0
2
3
-5
-2
0
2
0
1
-2
3
0
4
1
4
2
Here is the code I am using to recode it:
HGBlt10Points2008 = recode(HGlt10RawPerc
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
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
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
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
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
2004 Apr 03
3
Seeking help for outomating regression (over columns) and storing selected output
Hello,
I have spent considerable time trying to figure out that which I am about to describe. This included searching Help, consulting my various R books, and trail and (always) error. I have been assuming I would need to use a loop (looping over columns) but perhaps and apply function would do the trick. I have unsuccessfully tried both.
A scaled down version of my situation is as follows:
2009 Jul 01
2
recoding charactor variables with special charactors
I have a several character variables that I need to recode, but some of them have special characters like single quote or ( ). How tell R to ignore these special characters so I can rename them? Below is the error message I am getting.
social$FamilySupport[social$FamilySupport=="Mr. XXXs' extended family live in the Nashville area where he and his wife reside."]<-"Highly
2005 Jul 28
1
Unexpected behavior in recode{car}
Thanks to the R creators for such a great statistical system. Thanks to
the R help list, I have (finally) gotten far enough in R to have a
question I hope to be worth posting.
I'm using the recode function from John Fox's car package and have
encountered some unexpected behavior.
Consider the following example:
## Begin cut-and-paste example
require( car )
set.seed(12345)
nn <-