Displaying 20 results from an estimated 10000 matches similar to: "Indexing problem with matrix"
2011 May 12
3
assigning creating missing rows and values
I have a dataset where I have missing times (11:00 and 16:00). I would like
the outputs to include the missing time so that the final time vector looks
like "realt" and has the previous time's value. Ex. If meas at time 15:30 is
0.45, then the meas for time 16:00 will also be 0.45.
meas are the measurements and times are the times at which they were taken.
meas<-runif(18)
2011 Oct 11
2
replicate data.frame n times
Hi,
is there a way to replicate a data.frame like you can replicate the entries of a vector (with the repeat-function)?
I want to do this:
x <- data.frame(x, x)
(where x is a data.frame).
but n times.
And it should be as cpu / memory efficient as possible, since n is pretty big in my case.
thanks for any suggestions!
2011 Jul 14
5
Adding rows based on column value
Dear all,
I have one problem and did not find any solution.(I have also attached the problem in text file because sometimes column spacing is not good in mail)
I have a file(file.txt) attached with this mail.I am reading it using this code to make a data frame (file)-
file=read.table("file.txt",fill=T,colClasses = "character",header=T)
file looks like this-
Chr Pos
2011 Jun 28
4
how to print "<=" in plot title
Hi, how can I print "<=" (I mean the symbol of just one character) in the main
title of a plot?
for example:
plot(1:10, main=paste("x <=", x))
where variable x is some number generated on the fly.
Thanks
John
2011 Aug 15
2
Regression - how to deal with past values?
Dear R-users
I need to fit a nonlinear model to a piece of data. The model to be fitted
uses past values of the input and the ouput - something like
y(k) ~ f(y(k-1),y(k-2),u(k),u(k-1) ....) (k is time index). As far as I
know I could use earth(MARS), nnet and etc but I am not sure how to deal
with the past values since most, if not all, examples I saw formula does not
take in account past
2011 May 18
3
R Style Guide -- Was Post-hoc tests in MASS using glm.nb
Thanks Bill. Do you and others think that a link to this guide (or
another)should be included in the Posting Guide and/or R FAQ?
-- Bert
On Tue, May 17, 2011 at 4:07 PM, <Bill.Venables at csiro.au> wrote:
> Amen to all of that, Bert. ?Nicely put. ?The google style guide (not perfect, but a thoughtful contribution on these kinds of issues, has avoiding attach() as its very first line.
2011 Jul 26
5
Help with boxplot
Hi guys,
I need your help with the boxplot.
I've to create a boxplot starting from a table (.csv) in which there are the
result of a test.
Each column is a question and the rows are the answer of the respondents
(from 0 to 5).
Some answer is missing and has been filled with NA.
the table has been loaded in R with the function read.csv
I created the boxplot with the function boxplot and all
2011 Jun 24
4
What does class "call" mean? How do I make class "formula" into a "call"?
I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they have the same format but they are different because when I look at their attributes, class(eqSystem[[1]]) is "call" but class(tabs[[1]]) is "formula". I want to have class(tabs[[1]]) as a call too. So what does "call" mean? And how
2011 Jul 06
1
elegant way of removing NA's and selecting specific values from a data.frame
I have a data.frame "e" and would like to extract the 23rd column,
remove any NA's and then remove any values >= 30. I can do it in steps
such as this but have failed to figure out how to do it in a single line
.... any suggestions?
first <- e[,23]
second <- first[!is.na(first)]
third <- second[second<=30]
thanks a bunch
J
--
Dr. Jim Maas
University of East
2011 Aug 20
1
How to abort function execution after x-seconds
Hello all,
I'm running a parameter grid optimization ( ksvm, kernlab package) and
the optimizer
seems not to converge for certain parameters and stays in a infinity loop.
Would it be possible to abort the execution after x-seconds and continue
with the next parameter set? Which R function do need to use to
accomplish this?
I had a look at, try() etc. but they didn't seem so fit my
2011 May 24
1
ANOVA Residual SS and MS of 0
I am trying to run an ANOVA on my soil respiration data, but I keep getting
residual sum of squares and mean square of zero.
As I understand it that would mean that the model terms explain all of the
variation in the response variable. That should be virtually impossible,
should it not?
Where do I begin troubleshooting such a problem?
--
View this message in context:
2011 Apr 09
1
Robust Statistics for Outlier Detection
Hi Dear All,
Can someone give me a suggestion about which robust statistics are most
appropriate for outlier detection in linear models, and is available with R
?
Thanks for any idea.
--
View this message in context: http://r.789695.n4.nabble.com/Robust-Statistics-for-Outlier-Detection-tp3438493p3438493.html
Sent from the R help mailing list archive at Nabble.com.
2011 May 19
1
Converting Variable Name into String
Hello,
I would like to create lagged and delta variables from a set of variables
and then add them to a dataframe
Suppose that GDPPcSa is a variable. I would like to be able to do this
QuarterlyData$D1GdpPcSa = diff(GDPPcSa , 1)
in an automated fashion so that I loop over Quartely data to compute the
first difference of its variables and add them to the dataframe.
.It would be great to get a
2011 May 24
1
anyone using LARS package in R
Hi useR's,
Has anyone used the "Lars" package in R before? If so, is there any tutorial
(not manual) or worked out example online for this R package that one can go
through to figure out how one can use this package with lasso regression?
I appreciate any help I can get in this direction.
Sincerely,
Vishal
--
*Vishal Thapar, Ph.D.*
*Scientific informatics Analyst
Cold Spring
2011 Jun 13
1
Composing two n-dimensional arrays into one n+1-dimensional array
If I have 2 n-dimensional arrays, how do I compose them into a n+1-dimension
array?
Is there a standard R function that's something like the following, but that
gives clean errors, handles all the edge cases, etc.
abind <- function(a,b) structure( c(a,b), dim = c(dim(a), 2) )
m1 <- array(1:6,c(2,3))
m2 <- m1 + 10
abind(m1,m2)
==>
, , 1
[,1] [,2] [,3]
[1,] 1 3 5
2011 Jun 17
1
Factor labels
Please, can you help me with the following? I want to include a Greek letter
as part of a factor label that I need to use as factor on a xyplot. Probably
this was already solved so can I get the place where I can look for?
Thanks,
Hugo
[[alternative HTML version deleted]]
2011 Jul 28
1
Python difflib R equivalent?
Hi,
Does anyone know of a R library that is equivalent in functionality to
the Python standard libraries' difflib library? The python docs say
this about difflib:
"This module provides classes and functions for comparing sequences.
It can be used for example, for comparing files, and can produce
difference information in various formats, including HTML and context
and unified
2011 Aug 03
2
limits on liniar model
Can I put limits on the lm() command? I only know that you can choose a
liniar model with or without an intercept, but can I put other limits on
the coefficients (for example- the intercept must be bigger than 1) ?
_________________________________________________________________
Walla! Mail - [1]Get your free unlimited mail today
References
1. http://www.walla.co.il/
2011 Aug 15
1
constraining betas with mlogit package
I have been using the mlogit package but can't seem to figure out how to make constraints on the beta coefficients.
For example, I would like to force that two of my beta's are equal to each other.
Thanks in advance.
Jonah
2011 Aug 29
1
Difference between a data frame and data table
I didn't learn about data tables until recently. (They're never covered in
any intro R books).
In any case, I'm not sure what (if any) is the difference between a data
frame and a data table.
Can anyone provide a brief explanation?
Is one preferred over another or is it just dependent on the task at hand?
Thanks,
Abraham M.
[[alternative HTML version deleted]]