Displaying 20 results from an estimated 9000 matches similar to: "creating a factor from other factors and ifelse"
2011 Aug 10
2
join columns
Dear R-help,
I wonder if you could give me some suggestions in how to do a union
join of two data frames as follow:
-> union join the common column, and insert a 0 if one is missing.
I made a function to perform the following, and I know it may not that
quite welly written, but it works.
Any suggestions are welcome, many thanks.
Anthony
> q1 =
2020 Apr 15
2
Can't start vm with enc backing files, No secret with id 'sec0' ?
Hey, guys
I've been working on whether libvirt supports encrypted snapshots,Here are my versions of libvirt and qemu
[root@xx ~]# libvirtd -V
libvirtd (libvirt) 4.5.0
[root@xx ~]# qemu-img -V
qemu-img version 2.12.0 (qemu-kvm-ev-2.12.0-33.1.el7_7.4)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
1. assign $MYSECRET to libvirt secret using the secret-define and
2005 Jan 19
2
signif() generic
Dear list,
I'm trying to write a class for Gaussian error propagation of measured
values and their (estimated) errors,
> setClass("sec", representation(val="numeric", err="numeric"))
I've already successfully implemented basic arithmetics using mostly the
"Arith" group generics. But I'm running into trouble when trying to get
signif() to
2011 Jun 20
3
Unreasonable syntax error
http://r.789695.n4.nabble.com/file/n3612530/PSC.r PSC.r
Hi all,
I just wrote a program in R by editing it in Microsoft Word and then pasting
into the text editor of R. The above is the file.
And below is what the console complains.... Why doesn't it recognise 'r'??
I have to mention that at least when I typed this first several lines into
the console, the first error didn't
2012 Nov 28
1
in Rd documentation, line breaks in code blocks?
Hi everyone,
following the gentle advice from this list, I write a package
description Rd file.
I have a section in there. In this section, I have a subsection. In
this subsection, I want to have a code fragment. This code fragment
should include several commands, spanning several lines.
Example:
==========
\name{aqr-package}
\alias{aqr-package}
\alias{aqr}
\docType{package}
\title{Package
2013 Feb 27
2
matrix multiplication
Hi,
Try this:
#mat1 is the data
res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2006 Mar 10
3
RFC Follow Me Find Me script
This is a follow/find me script that I can't quite get to work, asterisk
wont save forward/${calleridnum} to AstDB... any comments or thoughts on
how to make this work or change it to work differently are appreciated.
The voice prompts to go with all playback/background extensions are
commented appropriately. I hope this code is of use to some of you and
any help with a perfected
2006 Oct 24
0
incorrect number of subscriptions error in user-written function
I have written a function which returns an "incorrect number of
subscriptions error" and am unable to identify why this should happen.
Any help would be gratefully received.
The problem:
I would like to generate combinations/permutations across different
selections - for example all the combinations of "3 chosen from 6"
combined with "5 chosen from 8" combined with
2007 Apr 11
1
Programming Problem (for loop, random # control, 3 dimentional graph)
Dear List,
This is just a programming problem which i cannot seem
to figure out. I am trying to get a set of power from
a test (say, kolmogorov smirnov) out of a distribution
(say, G-K distribution) as follows. I am trying to
reduce to pain of writing the whole set of data points
(p# below) using "for" loop. However, I seem to have
some problem in it as the output "M" does not
2005 Oct 15
1
Samba ignores write and read list
Hi everybody,
I have problem with samba and really don't know how to solve it.
Seems as if samba ignored write list and read list options in smb.conf.
Because when I have
writeable = yes
read list = dummy
user dummy can still write/delete. When I try to do it opposite, i.e.
read only = yes
write list = dummy
then dummy cannot write.
The point is, I have bunch of users specified by valid
2007 Apr 13
3
RJS - replacing html for multiple entries
I have some elements that could show up on the same page multiple times.
Can anyone recommend a good way to do a replace_html in this case? I
may have, for example, 3 posts that have been repeated on a page, all
with the same id (e.g, <div id="post-11">) and I want to perform a
replace_html against all of them. Doing it the normal way just replaces
the first. Can someone help?
2003 Oct 25
2
Voicemail help
hi,
i am trying to do autoattendant but failing. as in the
manual i inserted the background(welcome-mainmenu)
file so that after the sound the caller can dial the
extension he wants to call. i figured that the
background sound wasn't coming in the asterisk. how do
we do this without first loading the welcome message?
for example after certain rings the caller can dial
the extension no to
2006 Mar 25
2
pairwise combinatons of variables
Dear WizaRds,
although this might be a trivial question to the community, I was unable to
find anything solving my problem in the help files on CRAN. Please help.
Suppose I have 4 variables and want to use all possible combinations:
1,2
1,3
1,4
2,3
2,4
3,4
for a further kmeans partitioning.
I tried permutations() of package e1071, but this is not what I need. Thank you
for your help and
2007 Jun 27
3
exaustive subgrouping or combination
Dear Colleagues,
I am looking for a package or previous implemented R to subgroup and
exaustively divide a vector of squence into 2 groups.
For example:
1, 2, 3, 4
I want to have a group of
1, (2,3,4)
(1,2), (3,4)
(1,3), (2,4)
(1,4), (2,3)
(1,2,3), 4
(2,3), (1,4)
...
Can someone help me as how to implement this? I get some imaginary problem
when the sequence becomes large.
Thanks much in
2009 Sep 21
2
Four concurrent Markov chains
Hi,
I am trying to write a simulation of the movements of four animals between
six patches. The movement between patches is based on a first-order Markov
chain so that the next patch they visit depends on the patch they were in
before.
I have written code that allows me to simulate the movement of one animal
but when I add more there seems to be a problem and all chains come back as
N/A. I can
2010 Sep 16
1
rep within an ifelse statment
I have come across simple problem in R and I was hoping
someone out there could help me out. Here is the problem: I am trying to
set up and rep statement with a conditional statement using ifelse. Here is
simple example.
> y=5
> o<-ifelse(y==5,rep(2,4),NA)
> o
> [1] 2
>
> If I check my conditional
>
> > y==5
>
> [1] TRUE
>
> And if
2006 Mar 22
7
VERY IMPORTANT(TREAT WITH URGENCY)
Andrew D Kirch
Indianapolis, United States
Good day,
I am Mr. Andrew D Kirch, a native of Indianpolis, United States and I am
an Asterisk Hacker with the
Summit Open Source Development Group. First and foremost,I apologized
using this medium to reach you for a transaction/business of this magnitude,
but this is due to Confidentiality and prompt access reposed on this
medium. Be informed
2009 Nov 20
2
Problem with Numerical derivatives (numDeriv) and mvtnorm
I'm trying to obtain numerical derivative of a probability computed
with mvtnorm with respect to its parameters using grad() and
jacobian() from NumDeriv.
To simplify the matter, here is an example:
PP1 <- function(p){
thetac <- p
thetae <- 0.323340333
thetab <- -0.280970036
thetao <- 0.770768082
ssigma <- diag(4)
ssigma[1,2] <- 0.229502120
2012 Jun 20
3
[LLVMdev] Is Loop Dependence Analysis Printing Correct Stats?
Hi;
I was playing with the -lda pass of LLVM on the following program-
#include <stdio.h>
void main()
{
int a[10];
int i;
for(i = 0; i < 4; i ++)
{
a[i] = a[i-1]+1;
}
}
I run the following commands -
clang a.c -emit-llvm -S
opt -analyze -stats -lda a.s
The output is -
Printing analysis 'Loop Dependence Analysis':
Loop at depth 1, header block: %for.cond
Load/store
2011 Mar 01
3
inefficient ifelse() ?
dear R experts---
t <- 1:30
f <- function(t) { cat("f for", t, "\n"); return(2*t) }
g <- function(t) { cat("g for", t, "\n"); return(3*t) }
s <- ifelse( t%%2==0, g(t), f(t))
shows that the ifelse function actually evaluates both f() and g() for
all values first, and presumably then just picks left or right results
based on t%%2.