similar to: Using substitute in nested function calls

Displaying 20 results from an estimated 3000 matches similar to: "Using substitute in nested function calls"

2011 Oct 10
3
How to test if two C statistics are significantly different?
Hey all, In order to test if a marker is a risk factor, I built two models (using cox proportional hazard model). One model included this marker, and the other is not. Then, I use R package risksetROC to test how much predictive value did the marker add to this model. I get two C statistics by analyzing the linear predictors of the two models into this package. The qustion is How to test if two
2012 Aug 02
6
Polygon shaded area
Hi all, I have two vectors (columns) called "efinal" and "efinal 2". I want to plot them on the same plot and "draw" a shaded area beween the two lines using function polygon I have tried all but I don ?t understand the polygon area, can you help me with examples? plot(efinal,type="l",ylim=range(min(efinal2),
2011 Oct 22
7
"Plotting" text?
I noticed that the text() command adds text to a plot. Is there a way to either make the plot blank or add text to a "blank sheet". I would like to "plot" a page that contains just text, no plot lines, labels, etc. Suggestions? Kevin [[alternative HTML version deleted]]
2012 Apr 02
1
\Sexpr{}
Did anyone know whether the problem " it doesn't evaluate \Sexpr{} in Sweave" has been fixed? I checked r help page and realized it was asked a couple of years ago. But I didn't find solutions. Thanks for your help in advance! Hua [[alternative HTML version deleted]]
2011 Oct 24
2
splitting a string into words preserving blanks (using regex)
I would like to split a string into words at its blanks but also to preserve all blanks. Example: c(" some words to split ") should become c(" ", "some", " ", " words", " ", "to" , " ", "split", " ") I was not able to achieve this via strsplit() . But I am not familiar with regular
2011 Dec 05
1
Toggle cASE
Hello R-help list,   I am looking for way to toggle the case of the characters like a flip-flop; that is from ''Hello'' to "hELLO" or vice versa.   I know that there are a number of functions like casefold, tolower, toupper, etc. but these functions change the case in an uniform way.   Thanks in advance,   Antonio Rivero Ostoic         Antonio Rivero Ostoic PhD Student,
2011 Oct 11
2
Parallel processing for R loop
I have an R script that consists of a for loop that repeats a process for many different files. I want to process this parallely on machine with multiple cores, is there any package for it ? Thanks -- Sandeep R Patil [[alternative HTML version deleted]]
2012 Jul 05
1
Import single variables from SPSS
Dear all, I have got a very big SPSS dataframe and I would like to just import one or a few variables (the dataframe has got a lot of colums). I used the package foreign but I couldn't find anything in there for my problem. Thank you very much for your help in advance. Marion [[alternative HTML version deleted]]
2011 Oct 13
2
how to plot two surfaces with lattice::wireframe
Hi all, I'd like to plot the Real and Imaginary parts of some f(z) as two different surfaces in wireframe (the row/column axes are the real and imag axes). I know I can do it by, roughly speaking, something like plotz <- expand.grid(x={range of Re(z)}, y={range of Im(z), groups=1:2) plotz$func<-c(Re(f(z),Im(f(z)) wireframe(func~x*y,data=plotz,groups=groups) But that seems like a
2012 Jun 01
2
Day or Month difference between dates???
HI, R-Users: I got a questions. have been struggling so long time.... I have this data: > m1$Year_Month 201009 201010 201011 201101 201102 > min(m1$Year_Month) 201009 I want to calculate the following two answers, how do I program it? > difference in Month????? [1] 0 1 2 4 5 >difference in Days????? 0 31 61 .... Thank you in advance!!! Tammy [[alternative
2011 Oct 05
2
"unload" a library while testing?
Hi I am testing a package, and after I make changes, I have to close R and open R again to load the new version (same version number) of the package I am working on. So my question: is there a function which removes a package, i.e library(myPackage) > Package is loaded unlibrary(myPackage) > package is not loaded any more Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology,
2011 Oct 25
1
textplot in layout
Hello, Someone (Erik) recently posted about putting text on a plot. That thread didn't help. I'd like to put text directly below the 'sub' text (with no gap). The code below is the best I can do. Note the large undesirable gap between 'sub' and 'test'. I'd like the word 'test' to be just below the top box() boarder (directly below 'sub'). year
2011 Oct 05
3
help with regexp
Dear list memebers, I am stuck with using regular expressions. Imagine I have a vector of character strings like: test <- c('filename_1_def.pdf', 'filename_2_abc.pdf') How could I use regexpressions to extract only the 'def'/'abc' parts of these strings? Some try from my side yielded no results: testresults <-
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,
2012 Mar 28
2
Test Normality
Good Night I made different test to check normality and multinormality in my dataset, but I don´t know which test is better. To verify univariate normality I checked: shapiro.test, cvm.test, ad.test, lillie.test, sf.test or jaque.bera.test and To verify multivariate normal distribution I use mardia, mvShapiro.Test, mvsf, mshapiro.test, mvnorm.e. I have a dataset with almost 1000 data and 9
2011 Oct 20
1
How to remove all objects except the sequence
Dear All: I would like to know if there is plausible way to say to R to remove all elements in the memory but the sequence. I have a code which makes a loop, and what I want is after the programme has performed all the operation over every "i"th element, to remove all the objects, expect the sequence parameter. I included the option "rm(list=ls(all=TRUE))", but obviously that
2012 Jul 17
4
how to create table with file link in Rd File
Hi how to create table with file link in Rd File Thanks B.Purushothaman -- View this message in context: http://r.789695.n4.nabble.com/how-to-create-table-with-file-link-in-Rd-File-tp4636740.html Sent from the R help mailing list archive at Nabble.com.
2012 Jul 19
2
problem with using apply for dataframe
Dear people, I am including an example of a dataframe: mydataframe<-data.frame(X=c(1:4),total_bill=c(16.99,10.34,21.01,23.68),tip=c(1.01,1.66,3.50,3.31),sex=c("Male","Male","Male","Female")) When I use the sapply function getting the information about the factors works: sapply(mydataframe,function(x)is.factor(x)) X total_bill tip
2012 Jul 19
3
Finding the last value before a certain date
Hello all, I have a dataframe that looks like this: head(df) date y 1 2010-09-27 1356 2 2010-10-04 1968 3 2010-10-11 2602 4 2010-10-17 3116 5 2010-10-24 3496 6 2010-10-31 3958 I need a function that, given any date, returns the y value corresponding to the given date or the last day before the given date. Example: Input: as.Date("2010-10-06"). Output: 1968 (because the
2011 Oct 13
8
Remove specific rows in a matrix/data.frame
Hi, imagine the following matrix/data.frame Letter Number a 1 a 1 b 1 b 0 c 0 c 1 d 0 d 0 If the numbers for two identical letters are also identical then I want to remove either the first or the second row of that letter. If for a letter the numbers are 1 and 0 I want to remove the row with the 0. That means if the code works I would and up with the following matrix/data.frame Letter