similar to: recode vector values to NA

Displaying 20 results from an estimated 4000 matches similar to: "recode vector values to NA"

2001 Nov 28
1
Help with ICC
Hello, R-folks: Here is a statement I use to make a data frame: iccdata <- data.frame(i=rep(1:10,rep(2,10)),j=rep(1:2,10), x=c(0.35011,0.11989,0.13081,0.09919,0.16000,0.12000,0.00000,0.00000, 0.44023,0.32977,2.67081,2.63919,0.09050,0.03950,0.44019,0.30981,0.59000, 0.57000,4.03000,3.77000)) Then here are the data: > iccdata i j x 1 1 1 0.35011 2 1 2 0.11989 3 2 1 0.13081 4
2004 Jun 02
0
Request comments on missing data diagnosis code
Greetings, The attached code is my preliminary attempt to create a comprehensive missing data diagnostic package. I would greatly appreciate any constructive feedback about the code and encourage others to use it if they feel it is helpful. One warning might be in order - I have tested the mcar test only superficially. There might be a few other bugs but it mostly works for my initial
2004 Jun 02
0
Missing data diagnostics and apology
Greetings again, Seems I've touched a nerve with my previous post and after a few kind folks alerted me to a better distribution method I chose to put the code here: http://egad.psych.arizona.edu/mddiag.final.R.gz Any tips, criticisms, or additions are welcomed. Thanks for your patience. -- Cheers, Patrick _______________________________________________________________ Patrick E.
2003 Jan 16
1
installing the XML package
I'm trying to install the XML package in R 1.6.1 (>install.packages("XML")). The download is OK, but during configuration the file parser.h cannot be found (it looks in libxml/ and gnome-xml/ then gives up). What is missing from my system? -- Thanks, -susan Susan J. Miller Biotechnology Computing Facility Arizona Research Laboratories Bio West 228 University of Arizona
2007 Aug 14
1
weights in lmer
Dear R users, Prof. Ripley just corrected my understanding of the use of weights in glm, which I thought would allow me to correctly use lmer. However I'm still having problems. My data takes the form of # of infected and uninfected individuals that were measured over time under different treatments. I'm using lmer to adjust for the repeated measures over time. In fitting the
2004 Sep 08
1
pairwise comparisons
Hello, I am a new R user. I am trying to calculate vector correlations for all pairwise comparisons in my data frame without repeats. I am familiar with the expand.grid function, but this includes repeats. Is there a way to use expand.grid and eliminate repeats? Or is there another function that can be used to do this? Thank you. Rebecca -- Rebecca Young Graduate Student Ecology &
2003 Jul 24
1
bug? (PR#3550)
platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 7.1 year 2003 month 06 day 16 language R I have a Dell Inspiron 4000 laptop with Windows ME. I recently installed the 1.7 version of R. The following commands are from my
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
2004 Jan 30
1
Measures of central tendency - mode
Greetings, This seems too rudimentary to ask but for the life of me I cannot locate a readily easy method to compute the univariate mode. I know "mode" is not correct and "table" provides a reasonable count but I figured there would be an easy way to extract the value from the table after I do something like: max(table(mydadat$myvar)) unfortunately it only returns the max
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
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
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
2009 Jun 12
2
Sweave recode(car) and Lyx, compiling but not executing on Mac
I am just beginning to use Sweave with Lyx on a Mac (R2.8.1). I have 12 chunks of Sweave code that work fine, but this piece: <<>>= library(car)
2002 Jan 04
3
sorting data frame
Greetings, I hope this isn't obvious but I've read through the FAQ and the various other R/S books I have and I cannot, for the life of me, figure out how to sort a data frame by a specific variable. Suppose I have a four variable data.frame x and the variables are var1, var2, var3, var4. I want to sort on say var3 simply for display purposes. How can this be accomplished? Thanks
2010 Mar 30
2
How to recode variables using base R
Hi, Is there an efficient way recoding variables in a data.frame using base R? My purpose is to create new variables and attach them into old data.frame. The basic idea is shown below, but how to create recoding for A, B and C and assing them into new variables? df <- data.frame(A = c(1:5), B = c(3,6,2,8,10), C = c(0,15,5,9,12)) df$A[df$A <= 3] <- "x" df$A[df$A > 3 &
2013 May 07
2
recode categorial vars into binary data
Dear R-List, I would like to recode categorial variables into binary data, so that all values above median are coded 1 and all values below 0, separating each var into two equally large groups (e.g. good performers = 0 vs. bad performers =1). I have not succeeded so far in finding a nice solution to do that in R. I thought there might be a better way than ordering each column and recoding the
2013 May 07
2
recode categorial vars into binary data
Dear R-List, I would like to recode categorial variables into binary data, so that all values above median are coded 1 and all values below 0, separating each var into two equally large groups (e.g. good performers = 0 vs. bad performers =1). I have not succeeded so far in finding a nice solution to do that in R. I thought there might be a better way than ordering each column and recoding the
2013 Jan 25
1
Recoding variables (without recode() )
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130125/859c4520/attachment.pl>
2005 Aug 03
3
prcomp eigenvalues
Hello, Can you get eigenvalues in addition to eigevectors using prcomp? If so how? I am unable to use princomp due to small sample sizes. Thank you in advance for your help! Rebecca Young -- Rebecca Young Graduate Student Ecology & Evolutionary Biology, Badyaev Lab University of Arizona 1041 E Lowell Tucson, AZ 85721-0088 Office: 425BSW rlyoung at email.arizona.edu (520) 621-4005
2009 Nov 18
2
recode according to old levels
Dear R-users, i try to recode a factor according to old levels F <- factor(sample(c(rep("A", 4), rep("B",2), rep("C",5)))) recode(F, "levels(F)[c(1,3)]='X'; else='Y'") i tried to work with eval or expression around levels(F)[c(1,3)], but nothing seems to work. Many thanks if anyone could tell me what i've missed and what's