Displaying 20 results from an estimated 10000 matches similar to: "scaling-centering a vector using an index"
2002 Feb 20
2
Clustering and Calinski's index
I have to solve a clustering problem.
My first step is to determinate the number of clusters, that's why I 'm using
the Calinski index ( [tr(b)/(k-1)]/[tr(w)/(k-1)] ) which i try to maximize
to have the best number of clusters.
A function is already implemented in R to calculate this index :
clustIndex(cl,x, index="calinski")
where cl is the result of a clustering method ,
2006 Jul 13
1
Scalling/Centering the Data by an Index
Dear All:
I would like to center the data in 'x' by 'group'. The following code scale
the data and I have not been able to figure out how to change it so I get
the centered data.
x <- c(1, 2, 3, 4, 5, 6, 7, 8)
group <- c(1,1,1,2,2,2,2,2)
unsplit(lapply(split(x,group),scale),group)
I would appreciate your help.
Ashraf
2014 Oct 23
2
[Bug 85352] New: [NVC0/Gallium] Scaling/centering issue in shadertoy shader
https://bugs.freedesktop.org/show_bug.cgi?id=85352
Bug ID: 85352
Summary: [NVC0/Gallium] Scaling/centering issue in shadertoy
shader
Product: Mesa
Version: git
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/DRI/nouveau
2020 Nov 21
3
Error in unsplit() with tibbles
Hello,
using the `unsplit()` function with tibbles currently leads to the
following error:
> mtcars_tb <- as_tibble(mtcars, rownames = NULL)
> s <- split(mtcars_tb, mtcars_tb$gear)
> unsplit(s, mtcars_tb$gear)
Error: Must subset rows with a valid subscript vector.
? Logical subscripts must match the size of the indexed input.
x Input has size 15 but subscript `rep(NA, len)` has
2004 May 11
2
Probleme with Kmeans...
Hello,
I would like to have any help with the function Kmeans of R..
I use this to do a classification of my data...I have chosen 12 classes but, I have always an error message:
Error: empty cluster: try a better set of initial centers
So, I don't understand the probleme with this function..
Thank you to help me!!
All the Best
Clothilde
Clothilde Kussener
CNRS - CEBC
79360 Villiers en bois
2005 Sep 27
2
Using unsplit - unsplit does not seem to reverse the effect of split
In data OME in MASS I would like to extract the first 5 observations per subject (=ID). So I do
library(MASS)
OMEsub <- split(OME, OME$ID)
OMEsub <- lapply(OMEsub,function(x)x[1:5,])
unsplit(OMEsub, OME$ID)
- which results in
[[1]]
[1] 1 1 1 1 1
[[2]]
[1] 30 30 30 30 30
[[3]]
[1] low low low low low
Levels: N/A high low
[[4]]
[1] 35 35 40 40 45
[[5]]
[1] coherent incoherent coherent
2020 Nov 21
2
Error in unsplit() with tibbles
I get the sentiment, but this is really just bad coding (on my own part, I suspect), so we might as well just fix it...
-pd
> On 21 Nov 2020, at 17:42 , Marc Schwartz via R-devel <r-devel at r-project.org> wrote:
>
>
>> On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com> wrote:
>>
>> Hello,
>>
>> using the `unsplit()`
2006 Jun 08
1
NAs in unsplit factor
R-devel,
Below is a simple example calling split and unsplit on a numeric
vector of length 2 where 'f' is c(1,NA).
> unsplit(split(c(1,2), c(1,NA)), c(1,NA))
[1] 1 0
I noticed that the call to vector in unsplit gives us 0 as the 2nd
element of the result.
Is this the intended result, as opposed to NA?
Thanks for your help,
Jeff
--
Jeff Enos
Kane Capital Management
jeff at
2010 Apr 19
2
Using split and then unsplit
Hello everyone,
I use the split function splitting with the f function on a 3 columns and
more than 100 000 rows data frame. Once it's split I have a list of data
frames still with 3 columns and n rows. I manipulate those list elements and
get a list of data frames still with 3 columns but less rows. So when I
unsplit it, I get an error as I use the same factor function I used to split
( f in
2002 Jul 28
1
[R] bug in unsplit()? (PR#1843)
Hedderik van Rijn <hedderik@cmu.edu> writes:
> If the second argument to unsplit is not a simple vector (but a "list
> containing multiple lists"), the function seems to have some problems.
>
> Given a slight modification of the examples in help(split):
>
> > xg <- split(x,list(g1=g,g2=g))
> > unsplit(xg,list(g1=g,g2=g))
> [1] -0.7877109
2009 May 08
1
unsplit list of data.frames with one column
Perhaps this is the intended behavior, but I discovered that unsplit
throws an error when it tries to set rownames of a variable that has
no dimension. This occurs when unsplit is passed a list of
data.frames that have only a single column.
An example:
df <- data.frame(letters[seq(25)])
fac <- rep(seq(5), 5)
unsplit(split(df, fac), fac)
For reference, I'm using R version 2.9.0
2011 Mar 10
1
getting percentiles by factor
Hello,
I'm trying to get percentiles (PERCENTRANK for excel users) by factor in the
following data.frame:
myExample <- data.frame(Ret=seq(-2, 2.5,
by=0.5),PE=seq(10,19),Sectors=rep(c("Financial","Industrial"),5))
myExample <- na.omit(myExample)
Thanks to Patrick I I managed to put together the following lines which does
it for the "Ret" column:
myecdf
2011 May 19
1
Problems with unsplit()
Hi everyone,
I have already used split() and unsplit() in data frames without problems,
but now I’m applying these functions to other data and when using unsplit()
I have received the following message:
Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "2", "3", "4", :
duplicate ''row.names'' are not allowed
In
2010 Apr 13
2
efficiently picking one row from a data frame per unique key
Hello all, I'm trying to transform data frames by grouping the rows by the
values in a particular column, ordered by another column, then picking the
first row in each group.
I'd like to convert a data frame like this:
x y z
1 10 20
1 11 19
2 12 18
4 13 17
into one with three rows, like this, where i've discarded one row:
x y z
1 1 11 19
2 2 12 18
4 4 13 17
I've got a
2012 Jan 26
1
eRm - Rasch modeling - First item missing from estimation
I'm trying to kick off some of the rust and learn some of the R packages
for Rasch modeling. When I tried using the eRm package, I get item
difficulty estimates for all my items accept the first (in terms of order)
item.
#Begin code
library(eRm)
r.simulation <- sim.rasch(20,100)
r.data <- r.simulation$items
#eRm results
erm.rasch <- RM(r.data)
names(erm.rasch)
erm.items <-
2010 Feb 22
3
gsub patterns from vector elements w/out loop?
Dear list,
I have two vectors:
x <- c("one","two")
y <- paste(rep(x,2),"blah")
I want to replace all occurrences of each element of x in y with
something else, so that y looks like this:
y
[1] "something else blah" "something else blah" "something else blah"
[4] "something else blah"
I can do this using a loop:
for (
2008 Aug 11
1
Unexpected parameter problem using rsaga.geoprocessor() {RSAGA}
Hello,
I discovered SAGA, an interesting free GIS, a few days ago and now, I
would like to use it from within R 2.6.2 using the RSAGA package. I read
the documentation for this package and thought that I understood it
correctly for trying to call some of the SAGA modules. For getting the
information on the usage of and arguments required by the SAGA command
line "Import Binary Raw
2024 Sep 27
1
Is there a sexy way ...?
>>>>> Chris Evans via R-help
>>>>> on Fri, 27 Sep 2024 12:20:47 +0200 writes:
> Oh glorious!? Thanks Duncan.
> Fortune cookie nomination!
I don't disagree with the nomination -- thank you, Duncan!
However, please note that I'm sure Rolf's was challenged /
question was ment to work correctly for all factors `f` with
levels
2011 Aug 26
2
eRm/raschsampler error message
Hi, I am running the non-parametric rasch model tests using eRm. I have a
reasonably large dataset for this type of exercise (110 items, 248 persons).
I run:
> allb2=as.matrix(allb)
> rsample <- rsampler(allb2, ctr)
> t102<-NPtest(rsample, method="T10") #global test, subgroup inv
and receive error message as follows.
"Error in m[idx1, idx2] <- 1 : subscript out
2009 Sep 02
1
Ability Estimates for Repeated Measurements in the eRm Package
Dear R Users,
I am using the LLTM and the LRSM functions in the eRm package to do repeated
measurements where there are 2 measurement points for a list of 10 items. I
am trying to get ability estimates but am having trouble. I don't think
that it is appropriate to use the pmat function since the person parameters
are based on all 20 items. Rather, I think it would be more appropriate to