Displaying 20 results from an estimated 10000 matches similar to: "collapse argument on paste"
2013 Jan 27
2
Unexpected behavior with abbreviation of an argument to paste
R 2.15.1
OS X
Colleagues,
I encountered the following unexpected behavior today:
The following command yielded the expected result:
paste(c("TEXT1", "TEXT2"), collapse="|")
Result:
[1] "TEXT1|TEXT2"
However, abbreviating "collapse" by even one character:
paste(c("TEXT1", "TEXT2"), collaps="|")
yielded the
2011 Aug 15
1
update() ignores object
Hi all,
I'm extracting the name of the term in a regression model that
dropterm specifies as the least significant one, and I'm assigning
this name to an object. However, when I use update(), it ignores this
object. Is there a way I can make it not ignore it? A reproducible
example is below:
> lm(x1~1+y1*y2+y3+y4,data=anscombe)->my.lm
>
2008 Jan 11
1
Possible bug in R 2.6.1 (PR#10565)
Colleagues,
=20
In using the paste command I have to spell out the collapse option:
=20
> paste(1:3,coll=3D"a")
[1] "1 a" "2 a" "3 a"
> paste(1:3,collapse=3D"a")
[1] "1a2a3"
=20
My understanding is that the abbreviation coll should be adequate.
Actually, even collaps isn't enough:
=20
2008 Aug 13
1
summary.manova rank deficiency error + data
Dear R-users;
Previously I posted a question about the problem of rank deficiency in
summary.manova. As somebody suggested, I'm attaching a small part of
the data set.
#***************************************************
"test" <-
structure(.Data = list(structure(.Data = c(rep(1,3),rep(2,18),rep(3,10)),
levels = c("1", "2", "3"),
class =
2010 Feb 28
4
Reducing a matrix
I wish to rearrange the matrix, df, such that all there are not repeated x values. Particularly, for each value of x that is reated, the corresponded y value should fall under the appropriate column. For example, the x value 3 appears 4 times under the different columns of y, i.e. y1,y2,y3,y4. The output should be such that for the lone value of 3 selected for x, the corresponding row entries
2008 Dec 29
4
Merge or combine data frames with missing columns
Hi R-experts,
suppose I have a list with containing data frame elements:
[[1]]
(Intercept) y1 y2 y3 y4
-6.64 0.761 0.383 0.775 0.163
[[2]]
(Intercept) y2 y3
-3.858 0.854 0.834
Now I want to put them into ONE dataframe like this:
(Intercept) y1
2011 Dec 19
1
Training parameters for a HMM
Hi,
I'm a newbie to the world of HMMs and HMMs in R. I've had a look at
the hmm package and the RHmm package but I couldn't see anything
straightforward on how a labelled sequential dataset with observed
values and underlying states might be used to construct and train a
HMM based on that data and no pre-computed values for the transition,
emission or initial state distributions. Does
1998 Nov 09
2
no subject (file transmission)
RNG in R and Splus 3.4
Prof. Ripley asked the details of the example.
We were doing parametric bootstrap, so it is similar to simulation.
Anyway here is the details.
We start with a sample of 19 positive numbers. We know the sample
is from truncated exp(0.3)...only the truncation point, theta, is unknown.
In other words, the sample can be generated from something like
x1 <- rexp(100,
1998 Nov 09
2
no subject (file transmission)
RNG in R and Splus 3.4
Prof. Ripley asked the details of the example.
We were doing parametric bootstrap, so it is similar to simulation.
Anyway here is the details.
We start with a sample of 19 positive numbers. We know the sample
is from truncated exp(0.3)...only the truncation point, theta, is unknown.
In other words, the sample can be generated from something like
x1 <- rexp(100,
2011 Jun 28
2
How do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work
Greetings R Users,
I have a system of equations for which I would like to output all the
R-squares. Assume there are four equations in my system, the only way I
found to output all the R-squares is by calling them out one by one as this:
summary(fitSUR$eq[[1]])$r.squared
summary(fitSUR$eq[[2]])$r.squared
summary(fitSUR$eq[[3]])$r.squared
summary(fitSUR$eq[[4]])$r.squared
But isn't there a
2006 Aug 29
2
lattice/xyplot: plotting 4 variables in two panels - can this be done?
Hi,
I would like to create a plot of y1,y2,y3,y4 against x for several subjects such that y1 and y2 are plotted against x in one panel and y3 and y4 against x in another panel. Thus if there are 3 subjects I should end up with 6 panels. Is there a simple way of doing so (i.e. without calling xyplot() several times, and then padding the results together)??
Regards
S?ren
2011 Jun 23
0
Loops, Paste, Apply? What is the best way to set up a list of many equations?
Is there a way to apply paste to?list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)?such that I don't have to write form1=EQ1 for all my models?(I might have a list of 20 or more)? I also need the EQs to read the formulas associated with them.
For example, below, I was able to automate the name assignment but I could not figure out how to?to set up the list using?paste or other
2011 May 12
2
group length
Hi
I have four groups
y1=c(1.214,1.180,1.199)
y2=c(1.614,1.710,1.867,1.479)
y3=c(1.361,1.270,1.375,1.299)
y4=c(1.459,1.335)
Is there a function that can give me the length for each, like the made up
example below?
>function(length(y1:y2)
[1] 3 4 4 2
[[alternative HTML version deleted]]
[R-pkgs] New package: `lavaan' for latent variable analysis (including structural equation modeling)
2010 May 24
2
[R-pkgs] New package: `lavaan' for latent variable analysis (including structural equation modeling)
Hi Yves
lavaan looks like a very nice package. From the tutorial introduction
I see you create path diagrams for some of the models you describe.
How did you do this? I don't see a function for this in the package.
I know there is a path.diagram function in the sem package that uses
dot to draw the diagram, but I've always found the layouts from dot
somewhat strange for path diagrams
2006 Mar 16
1
running median and smoothing splines for robust surface f itting
loess() should be able to do robust 2D smoothing.
There's no natural ordering in 2D, so defining running medians can be
tricky. I seem to recall Prof. Koenker talked about some robust 2D
smoothing method at useR! 2004, but can't remember if it's available in some
packages.
Andy
From: Vladislav Petyuk
>
> Hi,
> Are there any multidimenstional versions of runmed() and
>
2002 May 11
2
modelling a particular design
Dear R- and Omega-list-members,
I am trying to make statistical inference about the following design:
A dependent variable y has been measured multiple times, i.e. 4 times
(y1,y2, y3, y4), unfortunately suffering from some successive dropouts (i.e.
the sample sizes varies for y1, y2, y3, and y4). For every y, two other
variables (covariates) were also measured: x & z, and both do presumably
2010 May 25
1
Assigning NA to a rows of a dataframe/datamatrix
Dear R-users, I have a problem, I have the following dataframe:
d<-data.frame(
'y1'=c(1,2,1,2,1,NA,NA),
'y2'=c(1,2,1,1,1,2,1),
'y3'=c(1,NA,1,NA,NA,2,1),
'y4'=c(NA,2,NA,1,1,2,NA),
'a'=c(1,1,1,1,1,1,2)
)
where the last variable counts the number of missing values in a row. Now, i want to set rows where a>1 to NA and arrive at something like the
2008 May 14
2
mfrow
Dear members,
I want to create 8 graphs and write it into one page using mfrow=c(4,2).
How to make all graphs (including the titles, legends, line types) to be
scale down (resized proportionally).
As an illustration, below is the code:
pdf("testmfrow.pdf")
par(mfrow=c(4,2))
x<-seq(1:10)
y1<-rnorm(10)
y2<-rnorm(10,mean=2,sd=1)
y3<-rnorm(10,mean=3,sd=1)
2007 Dec 05
1
Working with "ts" objects
I am relatively new to R and object oriented programming. I have relied on
SAS for most of my data analysis. I teach an introductory undergraduate
forecasting course using the Diebold text and I am considering using R in
addition to SAS and Eviews in the course. I work primarily with univariate
or multivariate time series data. I am having a great deal of difficulty
understanding and working with
2005 May 31
1
GLM question
I am unfamiliar with R and I’m trying to do few statistical things like GLM and GAM with it. I hope my following questions will be clear enough:
My datas ( y(i,j ))are run off triangles for example :
J=1
J=2
J=3
I=1
1
2
3
I=2
4
5
I=3
6
My model is :
E[y(i,j)] =m(i,j)
Var[y(i,j)] =constant *m(i,j)
Log(m(i,j)) = eta (i,j)
eta (i,j) = c + alpha(i)