Displaying 20 results from an estimated 10000 matches similar to: "as.numeric : what goes wrong?"
2009 Aug 28
4
Numeric, 2 ??? as a result of marix???
Strange things are going on in R, if you reshape a matrix in R:
> g=gretldata[1:2,]
> g
Empfang Versand Transit Inland Ausland SumS
1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341
2 421473.1 306445.4 448801.2 1779402 14445.6 2970567
> dim(g)
[1] 2 6
> as.vector(g)
Empfang Versand Transit Inland Ausland SumS
1 787844.0 1307176.6 223395.4 1474726 16199.1
2010 Mar 05
3
How to match vector with a list ?
Dear list,
I have a vector of characters and a list of two named elements :
i <- c("a","a","b","b","b","c","c","d")
j <- list(j1 = c("a","c"), j2 = c("b","d"))
I'm looking for a fast way to obtain a vector with names, as follows :
[1] "j1" "j1"
2004 Nov 04
3
keep dimension of a sub matrix
Hi,
is there any way to keep a sub matrix dimension?
exemple :
i1<-1; i2<-1
j1<-2; j2<-3;
ret <-matrix(1,4,4)[i1:i2,j1:j2] ;
dim(ret) is NULL because the submatrix single col or single row is coerce to a vector automaticaly.
How can i bypass this cast : submatrix->vector ???????
Thank you.
---------------------------------
[[alternative HTML version
2008 Sep 16
1
Car.proper C[] matrix
I am hoping someone can help translate some WinBUGS code into R code. I
would like to use R to create the C[] matrix required for a car.proper
model in WinBUGS, but I am having a difficult time negotiating the
coding. The C matrix provides normalized weights for each pair of
spatial areas. So the WinBUGS example is as follows:
# of the weight matrix with elements Cij. The first J1 elements
2013 Feb 18
2
error: Error in if (is.na(f0$objective)) { : argument is of length zero
Dear all,
I tried running the following syntax but it keeps running for about 4 hours
and then i got the following errors:
Error in if (is.na(f0$objective)) { : argument is of length zero
In addition: Warning message:
In is.na(f0$objective) :
is.na() applied to non-(list or vector) of type 'NULL'
Here is the syntax itself:
library('nloptr')
library('pracma')
#
2006 Nov 22
1
how to merge these dataframes
Hi,
Having 3 dataframes with different row numbers, but equal column names
(see below) I want to merge them by Var1 so I've tried:
merge(j1,j2,j3,by="Var1")
merge(j,j1,j2,by=names("Var1"))
But always got the same message:
Erro en fix.by(by.x, x) : 'by' must specify column(s) as numbers, names
or logical
What I'm doing wrong?
Thanks,
Antonio
j1
2011 Dec 29
3
Array element is function of its position in the array
I want to create a new array which selects values from an original array
based on a function of the indices. That is:
I want to create a new matrix Vnew[i,j,k]=Vold[i,j,ks] where ks is a
function of the index elements i,j,k. I want to do this WITHOUT a loop.
Call the function "ksfunction", and the array dimensions nis,njs,nks. I can
do this using a loop as follows:
# Loop version:
2007 Mar 09
1
Applying some equations over all unique combinations of 4 variables
#I have a data set that looks like this. A bit more
complicated actually with
# three factor levels but these calculations need to
be done on one factor at a
#I then have a set of different rates that are applied
#to it.
#dataset
cata <- c( 1,1,6,1,1,2)
catb <- c( 1,2,3,4,5,6)
doga <- c(3,5,3,6,4, 0)
data1 <- data.frame(cata, catb, doga)
rm(cata,catb,doga)
data1
# start rates
#
2002 Feb 22
3
Cent. Mov. Ave
Dear R People:
Here is an interesting question(I think)
Suppose I want to calculate Centered Moving Averages; i.e.
x[1] <- ( sum(y[1:12]) )/12
x[2] <- ( sum(y[2:13]) )/12
and so on.
Of course, this is easily done through loops. However, I have
been trying to do this more elegantly, but have failed. I have
tried things like
j1 <- 1:109
j2 <- 12:120
x[1:109] <- ( sum( y[j1:j2])
2015 Jan 20
6
[LLVMdev] Basic AliasAnalysis: Can GEPs with the same base but different constant indices into a struct alias?
Hi all,
This is covered by (struct-path aware) TBAA, but BasicAA disagrees.
See the attached testcase, where it prevents us from removing the
redundant load.
For arbitrary GEPs, we can't decide based on constant indices (because
of e.g., &A[0][1] and &A[1][0], with *A a one-element array). BasicAA
has some logic to "try to distinguish something like &A[i][1] against
2006 Jun 07
2
help with combination problem
hello:
I have 3 data.frame objects.
First df object:
Of dim (149,31). Columns 2:31 are marked as T1..T14
and N1..N16.
Name T1 T2 N1 T3 N2 N3 N4 T4
mu1 10 10 9 10 9 9 8 10
mu2 11 11 9 11 9 9 9 11
...
muN 12 12 9 11 9 9 8 12
Second df object:
of Dim (50000,31). Columns 2:31 are maked as T1...T14
and N1..N16.
2004 Oct 05
1
Why I don't hear Call Progress
I'm using sipgate.de as my sip provider. When I'm using xlite as client
on sipgate.de, everything works fine: I call number, hear ringing (real
progress tone form called party, not one generated in xlite) and then
talking with called person.
But, when I'm using Asterisk as sip client on sipgate.de, I don't hear
progress tones: I hear only one (locally generated) ring tone, and
2007 May 10
1
[LLVMdev] llvm-test / parallel runs
hello,
is there a simple way to run multiple benchmarks in parallel without
breaking the reporting scripts? currently there's an explicit -j1 in
Makefile.programs - i guess with purpose.
we're simulating our target architecture and parallel builds/runs on
multicore machines would drastically decrease the required simulation
time.
cheers,
-
dietmar
2016 Nov 11
3
dahdi_scan
lspci | grep Digium
03:05.0 Ethernet controller: Digium, Inc. Wildcard TE122 single-span
T1/E1/J1 card (rev 11)
dahdi_scan
So I have a card in a box - lspci shows it...
dahdi_scan reports nothing.
Is my card dead?
Jerry
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2020 Nov 12
2
nfs root kerberos
On 12/11/2020 13:27, Jason Keltz via samba wrote:
>
> On 11/12/2020 8:17 AM, Rowland penny via samba wrote:
>> On 11/11/2020 10:54, Jason Keltz via samba wrote:
>>> Hi Louis,
>>> I've looked into that and I'm not sure how this would be done?
>>> By the way, even with your NFS translation fix (which doesn't work
>>> for me because
2006 Apr 18
4
ISDN in Japan?
Hi all,
general query here --- I'm about to set up an asterisk box for use in Japan
but can't figureout if it's all ISDN there or what?
I have gathered so far that the two major providers, NTT and KVH both offer
ISDN lines with .......INS1500 and maybe INS64 protocols?
Not sure...
But I'm seeing stuff about J1 vs. T1/E1 ....
so does that mean I can't use a Digium card it
2003 Apr 04
2
biplot
Dear list,
I want to perform a biplot, using customized titels for the x and y axis.
Setting xlab="" and ylab="" resulted in an error, e.g.:
> data(USArrests)
> biplot(princomp(USArrests),xlab="",ylab="")
Error in biplot.default(t(t(scores[, choices])/lam), t(t(x$loadings[, :
length of dimnames[1] not equal to array extent
>
How do I
2005 May 18
1
fast matrix update
Hello,
I use extensively m[i0:i1,j0:j1] = ... to update matrices parts.
This writing is very convenient, but, since I'm doing this
calculus many many times, I would like to know if there is a way
(a hope ?) to do the same operation faster ?
Thanks for any advice or pointer.
Vincent
2015 Mar 13
2
[PATCH] guestfs.pod: don't encourage 'make syntax-check'
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
src/guestfs.pod | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/guestfs.pod b/src/guestfs.pod
index 377db21..70400a1 100644
--- a/src/guestfs.pod
+++ b/src/guestfs.pod
@@ -4158,10 +4158,6 @@ Runs the regular test suite.
This is implemented using the regular automake C<TESTS> target. See
the automake
2011 May 13
2
More effective calculation for loop
I am getting confused in how to use R effectively. Below is the example that I
would like to optimize, which is basically a loop. In its current version it
takes about 20 seconds to run. I have looked at the apply function and but
didn't seem to get it to work. I am sure this is relatively easy to show me a
better version for someone who has done this before. For some reason I seem to