similar to: numeric variables converted to character when recoding missing values

Displaying 20 results from an estimated 7000 matches similar to: "numeric variables converted to character when recoding missing values"

2006 Jul 31
2
math symbols and text with mtext()
Dear R users, Two questions: 1) Is there a way to simplify the mtext() line below ? beta=c(1,-1) m=5 plot(1) mtext( bquote(paste( beta == .(paste( "(", paste(beta, collapse=", "), ")" )) )), outer=TRUE,line=-3) 2) How do I get the embedded carriage return "\n" below to work, i.e for the text that follows it to appear on the next line? beta=c(1,-1) m=5
2007 Apr 17
2
Use of argument '...'
Dear R list, I've read the function writing sections on both "An introduction to R" and "R language Definition" manuals but still don't understand why the following gives an error message: fun <- function(x, ...) x + y fun(1, y=2) I get: Error in fun(1, y = 2) : object "y" not found I'd appreciate any help in understanding this. R version 2.4.1
2007 Jun 19
3
Controlling text and strip arrangement in xyplot
I've searched the archives and read the xyplot help but can't figure out the 2 lattice questions below? Consider: library(lattice) DF <- data.frame(x=rnorm(20), y=rnorm(20), g1=rep(letters[1:2], 10), g2=rep(LETTERS[1:2], each=10), g3=rep(rep(letters[3:4],each=5),2)) xyplot(y ~ x | g1 + g2, groups=g3, data=DF) 1) Is there a way to get one strip per row and column
2007 May 25
1
Speeding up resampling of rows from a large matrix
I'm trying to: Resample with replacement pairs of distinct rows from a 120 x 65,000 matrix H of 0's and 1's. For each resampled pair sum the resulting 2 x 65,000 matrix by column: 0 1 0 1 ... + 0 0 1 1 ... _______ = 0 1 1 2 ... For each column accumulate the number of 0's, 1's and 2's over the resamples to obtain a 3 x 65,000 matrix G. For those
2007 May 15
1
Efficiently reading random lines form a large file
I need to read two different random lines at a time from a large ASCII file (120 x 296976) containing space delimited 0-1 entries. The following code does the job and it's reasonable fast for my needs: lineNumber = sample(120, 2) line1 = scan(filename, what = "integer", skip=lineNumber[1]-1, nlines=1) line2 = scan(filename, what = "integer",
2007 Oct 18
2
image quality of plot inserted into PowerPoint
Dear R-helpers, I need to insert an R (2.6.0) generated plot containing semi-transparent colors into PowerPoint (2002). When I directly paste it from the clipboard or insert it as (enhanced) Metafile (I'm on Windows XP) the semi-transparent colors don't show. When I insert it at as a Bmp, Png or Jpeg and then convert to PDF the semitransparent colors do show but the quality of the image
2006 Sep 13
2
Retrieving value computed in inner function call
Dear R users, Consider the following example function: f = function(a,b) { g = function(x) a*x + b h = function(x) g(x)^2 + x^2 opt = optimize(h,lower = -1, upper = 1) x.min = opt$minimum h.xmin = opt$objective g.xmin = g(x.min) return(c(x.min, h.xmin, g.xmin)) } In my real problem the function that plays the role of "g" is costly to compute. Now, to
2012 Sep 05
2
Recoding categorical gender variable into numeric factors
I currently have a data set in which gender is inputed as "Male" and "Female" , and I'm trying to convert this into "1" and "0". I found a website which reccomended using two commands: data$scode[data$sex=="M"] <- "1" data$scode[data$sex=="F"] <- "2" to convert to numbers, and: data$scode <-
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"
2012 May 18
2
Recoding numeric value
I am a newbie and can't figure out how to recode a numeric value. In my data (pharm311), I have a column called "explain" and I need to find all the 6's and change it to NA (blank). Could someone help? I'm sorry if this is too basic, I started messing with R this week and got stuck with this problem since yesterday... Thanks in advance!
2011 Aug 31
1
Recoding observations in all columns of a data frame.
Dear all, Suppose I have a data frame like this: [code] var1 <- c(1,999,2) var2 <- c(999,1,2) var3 <- c(1,2,999) example <- data.frame(var1,var2,var3) [/code] I want to replace all 999 to NA in all observations in all columns. I know how to do it in each individual column. [code] example$var1[example$var1==999] <- NA [/code] I think it can be done with a for loop. [code] for
2009 Feb 23
1
[S] ASA Southern California Chapter Applied Statistics Workshop
The workshop organizing committee of the Southern California Chapter of the American Statistical Association announces the 28th Annual Workshop in Applied Statistics. Professor Colin Cameron from the department of Economics at UC Davis will give a one-day workshop titled "Advances in Count Data Regression." The event will take place on Saturday, March 28, 2009 at UCLA. Details on
2010 Mar 06
1
transposing data
Hi. I have repeated measures data of the form where each observation is a trial, and trials are grouped by subject, and variables encode whatever level of a factor was present during that trial, and the dependent variable is response time (RT). I want to transpose the data to a form suitable for MANOVA such that there is one observation per subject and RT is recoded across many
2015 Jul 30
2
POSIX-Share fails with NFS-mounts
Hi there, I'm sure this must have been discussed before, but I can't find anything that addresses exactly my problem in the archives. The problem I ran into is, that a samba-share relying on POSIX file-permissions stops working as soon as the shared folder is a NFS-mount itself. In that case, it is no longer possible for any user to access files or folders. So in my example, if
2008 Feb 08
2
R version of SAS Proc Varclus
I am interested in finding an R version of SAS "Proc Varclus". SAS's Proc Varclus implements an oblique cluster analysis based on principal components. How can I find out if R has a package that runs the same algorithm implemented in SAS "Proc Varclus"? Thank you, Mary Helen Black __________________________ Mary Helen Black, M.S. Keck School of Medicine of USC
2009 Jun 22
4
SAS-like method of recoding variables?
Dear R-helpers, I am helping a SAS user run some analyses in R that she cannot do in SAS and she is complaining about R's peculiar (to her!) way of recoding variables. In particular, she is wondering if there is an R package that allows this kind of SAS recoding: IF TYPE='TRUCK' and count=12 THEN VEHICLES=TRUCK+((CAR+BIKE)/2.2); Thanks for any help or suggestions you might be able
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
2013 Jan 30
2
recoding variables again :(
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130130/7bc4cd37/attachment.pl>
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