similar to: Passing a character argument onto a function

Displaying 20 results from an estimated 10000 matches similar to: "Passing a character argument onto a function"

2011 Mar 10
1
Help writing a Scheffe Contrast function for R
Hello, As a new user of R (less than a month) I have got my hands on several books and am pouting through the net looking for help in gaining understanding of this powerful tool. I am becoming more proficient with using basic functions to conduct basic statistics. I am now looking to learn how to write code. After a few small worthless functions I decided to try to create a function that was
2004 Jul 04
2
Random intercept model with time-dependent covariates, results different from SAS
Dear list-members I am new to R and a statistics beginner. I really like the ease with which I can extract and manipulate data in R, and would like to use it primarily. I've been learning by checking analyses that have already been run in SAS. In an experiment with Y being a response variable, and group a 2-level between-subject factor, and time a 5-level within-subject factor. 2
2010 Sep 29
1
Understanding linear contrasts in Anova using R
#I am trying to understand how R fits models for contrasts in a #simple one-way anova. This is an example, I am not stupid enough to want #to simultaneously apply all of these contrasts to real data. With a few #exceptions, the tests that I would compute by hand (or by other software) #will give the same t or F statistics. It is the contrast estimates that R produces #that I can't seem to
2011 Mar 31
1
Sequential multiple regression
Hello, In the past I have tended to reside more in the ANOVA camp but am trying to become more familiar with regression techniques in R. I would like to get the F change from a model as I take away factors: SO... mod1<-lm(y~x1+x2+x3).......mod2<-lm(y~x1,x2).......mod3<-lm(y~x1) I can do this by hand by running several models in R and taking the MSr1/MSe1, MSr2/MSe2... This is
2012 Jun 03
2
a question about subsetting
Hi all, I started using R about 3 weeks ago, and now I've pretty much figured out how to do the types of statistical modeling, graphs, tables etc. that I frequently  use (with zero background in computer languages or other statistical packages that are similar to R like S or SAS!). So it's been a  quite  rewarding process so far, and I thank you all R gurus for all your generous help! That
2011 Jul 30
3
ifelse returns
Greetings R Community, I am working with the ifelse function and it is returning something unexpected. In the code the line with the MODE1 assignment the output is a vector [1] 4 5 6 but when I put the MODE1 object into the ifelse function [R}'s output for MODE1 is the first number from the string (4). Why is this? Given the supplied vector of x I would assume both the MODE1 and ifelse()
2011 Oct 30
1
Normality tests on groups of rows in a data frame, grouped based on content in other columns
Dear R users, I have a data frame in the form below, on which I would like to make normality tests on the values in the ExpressionLevel column. > head(df) ID Plant Tissue Gene ExpressionLevel 1 1 p1 t1 g1 366.53 2 2 p1 t1 g2 0.57 3 3 p1 t1 g3 11.81 4 4 p1 t2 g1 498.43 5 5 p1 t2 g2 2.14 6 6 p1 t2 g3 7.85 I
2011 Sep 18
1
Planned comparison ANOVA
I am trying to do a priori ANOVA analysis for a class assignment. The professor uses SPSS and does not know R. I want to do a simple planned comparison but have been unable to find a function or specific help. There is a grouping variable with five levels and a subsequent response variable. I also created a few columns that contain my group contrasts to see if anything could come of that. My first
2004 Jan 14
1
Collapsing a factor in R
I'm trying to collapse the following table along the sub-group factor. In this case, collapsing means taking the average ages within a subgroup and creating a new table. I seem to be running into trouble trying to create this new data frame. I can use the ave() function to find averages within a subgroup but how do I maintain the Group/Gender factors after collapsing? (see bottom table) Can
2012 Jun 25
2
Fast Kendall's Tau
Hello. Has any further action been taken regarding implementing David Simcha's fast Kendall tau code (now found in the package pcaPP as cor.fk) into R-base? It is literally hundreds of times faster, although I am uncertain as to whether he wrote code for testing the significance of the parameter. The last mention I have seen of this was in 2010
2010 Nov 23
1
using the "apply" method for functions with multiple inputs
hello r users, i'm trying to use the apply method on a function with several inputs, but cannot figure out how to send multiple arguments to the function (not multiple runs of the same function, but one run of the function including two variables - each used within the function). a <- c(1:10,999,999,999) b <- c(11:20,999,999,999) tfun <- function(x,y){ if( (x = 1 & y !=999)
2010 Nov 11
3
Evaluation puzzle
The survexp function can fail when called from another function. The "why" of this has me baffled, however. Here is a simple test case, using a very stripped down version of survexp: survexp.test <- function(formula, data, weights, subset, na.action, rmap, times, cohort=TRUE, conditional=FALSE, ratetable=survexp.us, scale=1, npoints, se.fit,
2011 Nov 15
2
Problem creating reference manuals from latex
R Community, I often am in need of viewing the reference manuals of packages and do not have Internet access. I have used the code: path <- find.package('tm') system(paste(shQuote(file.path(R.home("bin"), "R")),"CMD", "Rd2pdf",shQuote(path))) someone kindly provided from this help list to generate the manuals from the latex files. This
2011 Mar 30
2
summing values by week - based on daily dates - but with some dates missing
Dear everybody, I have the following challenge. I have a data set with 2 subgroups, dates (days), and corresponding values (see example code below). Within each subgroup: I need to aggregate (sum) the values by week - for weeks that start on a Monday (for example, 2008-12-29 was a Monday). I find it difficult because I have missing dates in my data - so that sometimes I don't even have the
2013 Aug 24
3
Parts of Speach Tagging
I was using tagPOS function from openNLP package for parts-of-speach. Now the package is updated and the function is not present. Any suggestions how to do it now ? Thanks for your help. -- Regards, Siddharth Arun, Contact No. - +91 8880065278 [[alternative HTML version deleted]]
2009 Feb 06
1
Linear model: contrasts
Hey, I am modelling a linear regression Y=X*B+E. To compute the effect of ?group? the B-values of the regressors/columns that code the interaction effects (col. 5-8 and col. 11-14, see below) have to be weighted with non-zero elements within the contrast "Group 1" minus "Group 2" (see below). My first understanding was that the interaction effects add up to zero in each group.
2011 Aug 23
2
Opening package manual from within R
Simple question but searching rseek did not yield the results I wanted. Question: Is there a way to open a help manual for a package from within R. For instance I would like to type a function in r for the tm package and R would open that PDF as seen here: http://cran.r-project.org/web/packages/tm/tm.pdf -The vignette function exists for vignettes [vignette("package.name")] so I
2003 Mar 02
1
model.frame.default problem in function definition
Could someone point me in the right direction for the following issue: A function is defined as follows: tfun <- function(dat) { fmla <- as.formula("y~x+z") dat2 <- dat mdl <- lm(fmla,dat2) mdl <- step(mdl) } Then the following code dat <- data.frame(x=1:10,z=1:10,y=(1:10)^2+10*(1:10)) tfun(dat) generates the output Start: AIC= 43.67
2001 Apr 03
2
the "primes" file
In message <Pine.LNX.4.30.0104031615270.8678-100000 at holly.crl.go.jp>, Tom Holro yd writes: >SRP has different requirements from Diffie-Hellman. In particular, >for SRP the generator must be primitive. It turns out that the "primes" >file contains only safe primes with primitive generators, and is thus >ideal for SRP, but so far in OpenSSH it has only been used for
2011 Nov 08
1
Rd2pdf error after 2.14 upgrade‏
> The command Rd2pdf was rather useful for opening a package's manual > when you don't have access to the Internet (by using latex to pdf > conversion). However the way the function seems to operate changed at > version 2.14 of R. The noted changes listed on CRAN for this function > are as follows (which doesn't seem like it would affect my usage as > below): >