Displaying 20 results from an estimated 20000 matches similar to: "using apply to loop"
2007 Dec 21
1
using apply to loop [SEC=UNCLASSIFIED]
Hi Louis,
You could try this:
# find the index of the maximum value in each row of _data_, #
disregarding the last column classified <-
apply(data[,-(nclass+1)],1,which.max)
## or, if the maximum may be repeated:
classified <- apply(data[,-(nclass+1)], 1, FUN = function(x) which(x ==
max(x)))
# the variable _truth_ is just the last column of _data_ ?
truth <- data[,nclass + 1]
?table
2017 May 18
2
Bug: floating point bug in nclass.FD can cause hist() to crash
Hello everybody,
This is a bug involving functions in core R package:
graphics::hist.default, grDevices::nclass.FD, and
base::pretty.default. It is not yet on Bugzilla. I cannot submit it
myself, as I do not have an account. Could somebody else add it for
me, perhaps? That would be much appreciated.
Kind regards,
Sietse
Sietse Brouwer
Summary
-------
Floating point errors can cause a data
2012 Oct 07
2
[PATCH] drm/nouveau: fix error handling in core/core object creation functions
Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
---
This patch relies on "drm/nouveau: remove >1 sclass support from nouveau_parent_create_".
There are *many* *more* code paths without proper error handling - I counted
at least 106 in 41 functions. If someone would like to do a bit of janitorial
work I marked those code paths and uploaded "patch" here:
2012 Oct 07
1
[PATCH] drm/nouveau: remove >1 sclass support from nouveau_parent_create_
It's unused (only one codepath passes sclass at all and it's always one),
broken (overwrites the same field, leaking previous one) and confusing.
Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
---
drivers/gpu/drm/nouveau/core/core/client.c | 2 +-
drivers/gpu/drm/nouveau/core/core/parent.c | 3 +--
1999 Nov 23
1
postscript colors
Is color specification like this available in R for setting
postscript colors?
> hue <- c(0, seq(from = 0, by = 1/(nclass), length = nclass))
> sat <- c(0, rep(1.0, nclass))
> bri <- c(0, rep(1.0, nclass))
> zcolors <- cbind(hue, sat, bri)
> ps.options (setcolor=ps.setcolor.hsb,colors=zcolors)
2013 Mar 26
1
randomLCA_with error for me
Please can someone explain to me how to use randomLCA in R for an analysis.
I tried using it and had this error (copied below) which indicated my
patterns must consist of 0 or 1. I assume I am doing something wrong.
Please help.
> library(lattice)
> library(boot)
Attaching package: ‘boot’
The following object(s) are masked from ‘package:lattice’:
melanoma
> library(utils)
>
2012 Oct 25
5
system is computationally singular: reciprocal condition number
Hi folks,
I know, this is a fairly common question and I am really disappointed that I
could not find a solution.
I am trying to calculate Mahanalobis distances in a data frame, where I have
several hundreds groups and several hundreds of variables.
Whatever I do, however I subset it I get the "system is computationally
singular: reciprocal condition number" error.
I know what it means
2011 Mar 12
1
Stepwise Discriminant... in R
Hello R list,
I'm looking to do some stepwise discriminant function analysis (DFA) based
on the minimization of Wilks' lambda in R to end up with a composite
signature (of metals "Al","Sb","Bi","Cr","Ba") capable of discriminating
100% of the source factors (LANDUSE: "A","B","C").
The Wilks' lambda
2008 May 19
2
How hist() decides breaks?
Hi Folks,
I'd like to know how hist() decides how many cells to use
when it ignores my "suggestion" to use say 'hist(...,breaks=50)'.
More specifically, I have the results of 10000 simulations,
each returning an 8-vector, therefore 8 variables each with
10000 values. Some of these 8 have somewhat skew distributions.
Say one of these 8 variables is X.
I ask for H <-
2004 Mar 26
1
color.ramp in maptools
Dear list members,
I am trying to use the maptools library to display geographical data. At
the moment I have some trouble understanding how the " auxvar " variable
is supposed to be used in the plot.Map function.
I am using R Version 1.8.1 (2003-11-21) on Linux
Looking at the plot.Map function itself, I see that it calls a
color.ramp function (I am reporting only the relevant
2005 Jul 07
1
Tables: Invitation to make a collective package
Hi All,
I would like to make an invitation to make a collective package with all
functions related to TABLES.
I know that there are many packages with these functions, the original idea is
collect all this functions and to make a single package, because is arduous for
the user know all this functions broadcast in many packages.
So, I think that the original packages can continue with its
2005 May 24
1
Contingency tables from data.frames
Dear list,
I'm trying to do a set of generic functions do make contingency tables from
data.frames. It is just running "nice" (I'm learning R), but I think it can be
better.
I would like to filter the data.frame, i.e, eliminate all not numeric variables.
And I don't know how to make it: please, help me.
Below one of the my functions ('er' is a mention to EasieR,
2001 Dec 05
3
Histograms per coding variable
Dear all
I have a dataset that looks like:
fr.wt site
1 4400 glen
2 235 glen
3 225 glen
' ' '
' ' '
' ' '
82 550 glen
83 550 kom
84 550 kom
' ' '
' ' '
' ' '
191 820 kom
192 2000 soet
' ' '
' ' '
I need to do a series of histograms for each of the codes, levels or
factors in
2003 Apr 17
2
make check failure with R-1.7.0
I'm baffled. When I run make check after installing from source, I
get a Error 2. From my understanding of how these things work, it
would appear to be coming from this (as at the end of base-Ex.Rout.fail:
> has.VR <- require(MASS, quietly = TRUE)
Attaching package 'MASS':
The following object(s) are masked from package:base :
confint confint.lm nclass.FD nclass.scott
2005 Apr 18
2
Very Slow Gower Similarity Function
Hello,
I am a relatively new user of R. I have written a basic function to calculate
the Gower similarity function. I was motivated to do so partly as an excercise
in learning R, and partly because the existing option (vegdist in the vegan
package) does not accept missing values.
I think I have succeeded - my function gives me the correct values. However, now
that I'm starting to use it with
2008 May 06
2
ActionController::InvalidAuthenticityToken in ClassifiedCon
I am editing a form it is taking the value but when i submit it
it shows the message
def edit
@classified = Classified.find(params[:id])
end
def update
@classified = Classified.find(params[:id])
if @classified.update_attributes(params[:classified])
redirect_to :action => ''show'', :id => @classified
else
render :action => ''edit''
end
end
and this is my
2010 Feb 24
2
Bimodal distribution
Hello,
Is there any test for bimodality in R that
x <- c(rnorm(1000,0,1),rnorm(1000,3,1))
hist(x,nclass=100)
Thank you in advance for any help.
Regards,
Samor
[[alternative HTML version deleted]]
2011 Nov 02
4
undefined method `updated_at' for #<Classified:0x686c5e4>
HEllo, I have the following problem with rails, I am new in this...is
there anyone who explain to me what´s happens?
Thanks
See below:
NoMethodError in Classified#show
Showing app/views/classified/show.rhtml where line #17 raised:
undefined method `updated_at'' for #<Classified:0x686c5e4>
Extracted source (around line #17):
14:
15: <strong>Date Posted:</strong>
2012 Aug 27
2
randomLCA
Can anybody, please, explain me how many parameter are estimated using
randomLCA?
For examples, model "dentistry.lca2random" estimate 1 scale (or
variance, b_j) parameter and 2 position parameters (a_cj)? Doesn't
it?
Do I need at least 4 diagnostic tests for such a model?
What happens if I specify options blocksize and byclass? How many
diagnostic tests (or rater) I need?
2007 Jun 14
3
problem with hist()
Hey everybody,
I try to make a graph with two different plots.
First I make a boxplot of my data. It is a collection off correlation
values of different pictures. For example:
0.23445 pica
0.34456 pica
0.45663 pica
0.98822 picb
0.12223 picc
0.34443 picc
etc.
Ok, I make this boxplot and I get for every picture the boxes. After this
I want to know, how many correlations per picture exist.
So I