Displaying 20 results from an estimated 400 matches similar to: "strange error with rw2010dev"
2011 May 23
1
Applying boxplot.stats to multiple value lists
Hello all R gurus,
I have a following problem which I hope someone will help me to solve.
I have a data.frame in form similar to below. > testframe<-data.frame("Name"=c("aa","aa","aa","aa","aa","bb","bb","bb","bb","bb"),"Value"=c(1,100,1,1,1,100,100,100,100,1))
2010 Nov 18
1
dmultinomial
Hello All,
I'm trying to run a maximum likelihood analysis using dmultinomial (i'm
avoiding dmultinom as I'd like to run it with vectors for the ML stuff).
However, I'm having a hard time getting even the simplest example
running. Any help would be greatly appreciated.
> library(mc2d)
> dmultinomial(x=c(0,0,1),prob=c(1,1,1),size=1,log=TRUE)
Error in if (ncol(x) != K)
2001 Oct 05
1
nls() fit to a lorentzian - can I specify partials?
First, thanks to all who helped me with my question about rescaling axes
on the fly. Using unlist() and range() to set the axis ranges in advance
worked well. I've since plotted about 300 datasets with relative ease.
Now I'm trying to fit a lossy oscillator resonance to (the square root of)
a lorentzian (testframe$y is oscillator amplitude, testframe$x is drive
frequency):
lorentz
2012 Jun 09
1
Applying a function to a column of a data frame
Apologees the novice question. Currently climbing up the learning curve of R.
Suppose I have the following function and the data.frame:
testfun<-function(x=1,y=2) x+y
testframe=data.frame(col1=c(1,2),col2=c(3,4))
When evaluating testfun, I want to use the default value for y (which
is 2) and for x, I want to feed (one by one) the values in col2 of
testframe. How can I achieve this please?
2012 Jun 10
3
Data.frames can not hold objects...What can be done in the following scenario?
R-Help community,
I understand that data.frames can hold elements of type double, string
etc but NOT objects (such as a matrix etc). This is not convenient for
me in the following situation. I have a function that takes 2 inputs
and returns a vector:
testfun <- function (x,y) seq(x,y,1)
I have a data.frame defined as follows:
testframe<-data.frame(xvalues=c(2,3),yvalues=c(4,5))
I would
2008 May 11
2
instabilities in wxRuby 1.9.6
I have recently started to use wxRuby, because I have used the wxWidgets
library from C++ for a few years and found it an excellent toolkit. I am
using Ubuntu 8.04 and version 1.9.6 of wxRuby.
A problem though is a number of instabilities. This may be due to my own
ignorance, but I have usually found C++/wxWidgets, once the program compiles
it will at least stay working, if at times
2011 May 25
1
matrix Manipulation...
Hello everyone,
I have a 2 x 5 matrix: say
0.2 0.3 1 -1 3
0.2. 0.4 5 0.5 -1
I want to replace all the values greater than or equal to 1 with 1 and those
less than or equal to 0 with 0. So I should end up with a mtrix looking
like:
0.2 0.3 1 0 1
0.2. 0.4 1 0.5 0
Any ideas how to do this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2011 Jan 13
1
s3 methods on S4 objects
I have J Chambers wonderful text ( Software for data Analysis) and I've been
trying
my hand at some very routine S4 OOP development.
One of the things I was trying to do was to create some very basic S4
classes. The first
was simply a class that had a data.frame as part of its representation.
setClass("df",representation(dirframe="data.frame"))
The object basically
2011 Dec 16
1
kmeans and plot labels
Hi,
Thanks Sarah. Unfortunately I did not get a step further.
My question, perhaps a bit clearer, is how to display the case control status (or any other arbitrary point label) after clustering in a plot:
With a bit of pseudo code, where dataset is a data.frame, parameters are those column names where we find numerical values (no NAs) and nclasses is the desired number of classes.
fit <-
2010 Oct 22
3
Conditional looping over a set of variables in R
Here's the problem I'm trying to solve in R: I have a data frame that consists of about 1500 cases (rows) of data from kids who took a test of listening comprehension. The columns are their scores (1 = correct, 0 = incorrect, . = missing) on 140 test items. The items are numbered sequentially and are ordered by increasing difficulty as you go from left to right across the columns. I want
2003 Jul 18
2
create a vector looping over a frame
Hello,
I have a data.frame
> names(popA)
[1] "Year" "Series" "Age" "WM" "WF" "HM" "HF" "BM"
[9] "BF" "IM" "IF" "AM" "AF" "Yr"
how do i loop over a subset of variables in this frame to create a vector of
2007 Feb 16
0
re : array searches
Hi,
I am not sure to get the issue, but assuming your data are arranged as
in your example with dates in column x$V1 and signals as x$V2 ,
I think that you could use "rle" in the following way :
test<-rle(x$V2)
testmat<-matrix(NA,length(test$values),2)
testmat[,1]<-x[c(1,cumsum(test$length)[1:(length(test$values)-1)]+1),1]
testmat[,2]<-test$values
And you'll get your
2017 Jan 27
0
Matrix package breaks as.matrix method
Hi,
The Matrix package and the as.matrix method do not seem to be compatible inside of a package.
Here's an example. I've created a simple package "mat" that defines an eponymous class and as.matrix method on that class. All is well, unless that package has the Matrix package in its Depends or Imports (and imports, e.g. the "Diagonal" function). Then my as.matrix
2017 Jan 30
0
Matrix package breaks as.matrix method
Georgi,
Brilliant, thank you very much for the helpful reply and explanation! I added 'importFrom("Matrix","as.matrix")' to my NAMESPACE and all worked fine! As my 'as.matrix' method is used entirely internally to the 'testmat' function (and not "used outside the package"), I don't think I actually need to export it. In my case, testmat is
2010 Dec 13
7
descriptive statistics
Hi. In a data set I have a variable that takes values from 1 to 14. For each
subgroup of values of this variable, I would like to obtain some descriptive
statistics of other variables present in the data set. I've been trying with
a "for" loop but I couldn't get nothing. Could you please suggest me some
lines?
--
View this message in context:
2024 Aug 02
2
grep
Good Morning. Below I like statement like
j<-grep(".r\\b",colnames(mydata),value=TRUE); j
with the \\b option which I read long time ago which Ive found useful.
Are there more or these options, other than ? grep? Thanks.
dstat is just my own descriptive routine.
> x
?[1] "age"????????? "sleep"??????? "primary"????? "middle"
?[5]
2017 Jan 29
0
R-devel Digest, Vol 167, Issue 25
Hi,
Short answer: import 'as.matrix' and export your method(s) for it. From WRE:
"All S4 classes to be used outside the package need to be listed in an exportClasses directive. Alternatively, they can be specified using exportClassPattern.(46) in the same style as for exportPattern. To export methods for generics from other packages an exportMethods directive can be used."
2008 May 20
0
[ wxruby-Bugs-20255 ] Instabilities on Linux - 1.9.7
Bugs item #20255, was opened at 2008-05-20 08:10
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=218&aid=20255&group_id=35
Category: Incorrect behavior
Group: None
Status: Open
Resolution: None
Priority: 4
Submitted By: Alex Fenton (brokentoy)
Assigned to: Alex Fenton (brokentoy)
Summary: Instabilities on Linux - 1.9.7
Initial Comment:
Segfaults after
2008 Apr 22
2
nth step transition matrices
Hello,
I have a question in regards to markov chains and transition
probabilities.
I am trying to figure out a way to calculate the "kth-step transition
matrix" of a given matrix.
Say for example I have a single step 2x2 matrix:
1 2
P= 1 .95 .05
2 .01. 99
If I were to convert this matrix to a 2-step transition probability
matrix I would get:
2011 Sep 30
1
Covariance-Variance Matrix and For Loops
Hello,
I am very new to R (as my Subject probably indicates).
I want to do something that should, I think, be very simple. I have five
vectors in a list and I want to construct a covariance matrix out of them.
Given a 5X5 matrix cvm1, and the list of vectors, cvm1_list, I thought the
following would work (sorry cannot find code tags):
for(i in 1:5){
for(j in 1:5){
cvm1[i,j] <-