Displaying 20 results from an estimated 11000 matches similar to: "subsetting a dataframe with a string logical expression"
2007 Jul 29
6
Isolating rails model specs from their implementation
I''m currently taking a Rails project management app I built when
learning Rails and adding specs to it. During the course of building
the app the requirement that project should be archiveable was added.
So a project is in one of two states active or archived.
This led to the creation of the following methods:
Project.active_projects
Project.archived_projects
@project.active?
2006 Apr 11
2
OT: Polycom IP501 Config file error - Error is 0x4020 (during autoboot...)
Using FTP to configure 501.
Gets past "Running... App = sip.ld"
and: Welcome! Processing configuration...
"This may take a few seconds."
Then it displays:
Config file error
Error is 0x4020
and reboots continuously, repeating the above.
Anyone seen this before?
Is this a corrupt *.ld file?
An FTP error? (PASV)?
A missing SETUP setting?
Thanks!
--
Jim Rice
by Design
2006 Apr 21
1
roundrobin strategy in queues not working as described?
I have set up an operator queue for our receptionist.
That way, if she takes a break or is out, by logging out of the queue,
calls to the "Operator" can be handled by other agents.
I have set strategy = roundrobin in queues.conf.
According to "the book" ATFoT, roundrobin always starts with the first
agent in the queue. This is the desired result. I want all calls to
start
2006 Nov 22
1
aastra 480i configuration help
I'm having problems getting my aastra 480i to register with the asterisk
server. I can inititate calls from the phone, but >sip show peers does not
show any IP address registered for this phone. I am probably missing
something stupidly simple. Anyone have an example config to share or
corrections for my configuration?
Asterisk 1.2
aastra 480i CT has the 1.4 firmware
<sip.conf>
2005 Sep 05
2
samba PDC -- really stuck here
Greetings,
I am running RH9
I had the PDC running but it wants to use roaming profiles, which I don't
really want, when I take out roaming profiles the none of the PCs can find
the domain controller. I have posted my globals section here could someone
please tell me what is wrong with it?
[global]
domain master = yes
pam password change = Yes
add user script =
2010 Feb 12
13
SSD and ZFS
Hi all,
just after sending a message to sunmanagers I realized that my question
should rather have gone here. So sunmanagers please excus ethe double
post:
I have inherited a X4140 (8 SAS slots) and have just setup the system
with Solaris 10 09. I first setup the system on a mirrored pool over
the first two disks
pool: rpool
state: ONLINE
scrub: none requested
config:
NAME
2009 Jul 16
1
matrix subsetting assignment with logical mask
If m is a matrix and s is a logical matrix of the same dimensions, I'd
like to be able to update m with
m[s] <- 0
If m2 is another matrix, I'd also like to be able to do
m[s] <- m2
where elements of m for which s is TRUE get the corresponding element of
m2.
However, this doesn't work in R 2.7.1. The best I've been able to come
up with is
> s
[,1] [,2] [,3]
[1,]
2003 Aug 26
3
Subsetting a dataframe
Hi R-people
I have a question concerning subsetting. I have a dataframe which contains among other variables the variable "subject". For each subject number there are several rows, e.g.:
subject treatment concentration day
19 a 15,4 1
19 a 18,3 2
19 a 2,3 3
etc.
Im trying to subset the dataframe to get for
2004 Jul 30
1
Subsetting dataframe
Dear R-help,
I have a question on subsetting a dataframe and I searched all of R-help to no avail. Please view the following example dataframe:
# Example
> x <- factor(rep(c(1,2,3,4),2))
> y <- c(1,4,3,2,1,2,5,1,2)
> z <- c(10,12,18,21,24,32,34,12,23)
> test <- data.frame(x, y, z)
> test
x y z
1 1 1 10
2 2 4 12
3 3 3 18
4 4 2 21
5 1 1 24
6 2 2 32
7 3 5 34
8
2010 Mar 24
1
flexible alternative to subsetting dataframe inside nested loops
I have a dataFrame variable:
L1 L2 L3 ... v1 v2 ...
1
2
3
4
...
I want to process subsets of it as defined by combinations of L1-L2-L3. I do
it successfully using nested loops:
for (i in valuesOfL1 {
for (j in valuesOfL2) {
for (k in valuesOfL3) {
tempData <- subset(dataFrame, (L1 == i & L2 == j & L3 == k,
select=c(v1,v2) ))
if
2010 Jun 04
1
subsetting a dataframe
Hi there,
> a<-data.frame(c(1,2,2,5,9,9),c("A","B","C","D","E","F"))
> names(a)<-c("x1","x2")
> max(table(a$x1))
[1] 2
>
The above shows the max count for x1 is 2, which is correct. But we can't tell
there are 2 groups that meet this criteria: 2,2 and 9,9.
I then want to extract the
2012 Jan 28
3
logical subsetting, indexes and NAs
Dear All,
just a quick example:
> x = 1:25
> x[12] = NA
> x
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
> y = x[x<10]
> y
[1] 1 2 3 4 5 6 7 8 9 NA
Is there any way of NOT getting NA for y = x[x<10]? Similarly
> y = x[x<15]
> y
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14
How do I get rid of the NA (not post
2018 Mar 12
0
Dataframe Subsetting comparison
Hello All,
I am facing a unique issue and am unable to find any help in R help pages
or online. I will appreciate your help for the following problem:
I have 2 data-frames, samples below and there is an expected output
R Dataframe1:
C1 C2 C3 C4...... CN
R1 0 1 0 1
R2 1 0 1 1
R3
2010 Oct 24
1
Subsetting a dataframe
Hi,
I have a dataframe with 43 columns and a 1000 rows. Each entry in the
dataframe can be either P or A.
here is a small chunk:
c1 c2 ... c43
r100 P A ... P
r101 A A ... A
r102 P P ... P
How does one subset this data frame to select those rows that have only P's
in them?
Thanks in advance.
Anjan
--
===================================
2003 Jan 22
1
dataframe subsetting behaviour
Hi,
I'm trying to understand a behaviour that I have encountered
and can't fathom.
Here's some code I will use to illustrate the behaviour:
# start with some data frame "a" having some named columns
a <- data.frame(a=rep(1,3),c=rep(2,3),d=rep(3,3),e=rep(4,3))
# create a subset of the original data frame, but include a
# name "b" that is not present in my
2013 Apr 06
1
Multiple subsetting of a dataframe based on many conditions
Hello Everybody,
I'm working with a dataframe that has 18 columns. I would like to subset the data in one of these columns, "present", according to combinations of data in six of the other columns within the data frame and then save this into a text file. The columns I would like to use to subset "present" are:
* answer (1:4) [answer takes the values 1 to 4]
*p.num
2003 Sep 10
2
dataframe subsetting
I can create a small dataset, "x" below, and subset out rows based on
values of a certain variable. However, on the dataset I'm working on now,
"latdata" below, I get a subscript error. Any advice is appreciated!
Ryan
Successful:
> is.data.frame(x)
[1] TRUE
> x
X1 X2 X3
1 1 3 5
2 2 4 6
> x[x$X2 %in% c(3),]
X1 X2 X3
1 1 3 5
Unsuccessful:
>
2003 Apr 07
4
subsetting a dataframe
How does one remove a column from a data frame when the name of
the column to remove is stored in a variable?
For Example:
colname <- "LOT"
newdf <- subset(olddf,select = - colname)
The above statement will give an error, but thats what I'm trying to
accomplish.
If I had used:
newdf <- subset(olddf,select = - LOT)
then it would have worked, but as I said the column
2002 Apr 23
3
Subsetting by a logical condition and NA's
I have run into a general problem with subsetting of which the following
is a simple example. Suppose that
x <- c(5, NA, 7, 5, NA, 3)
y <- c(1, 2, 3, 4, 5, 6)
I want to extract the values of y for which x = 5, but y[x==5] yields
> y[x==5]
[1] 1 NA 4 NA
I find that y[!is.na(x) & x==5] yields the desired result:
> y[!is.na(x) & x==5]
[1] 1 4
but I am wondering whether
2007 Jul 18
2
Subsetting Enigma: More rows after dataframe[-list,]?
Hello again,
I'm trying to purge the indexes in i.delete from frame and end up with more
rows!? Please be so kind and let me know where I screw this up ...
Joh
> i.delete
[1] 40 45 165 212 253 270 280 287 301 352 421 433 463 467
487
[16] 517 537 542 573 594 596 612 614 621 635 650 696 699 707
732
[31] 738 776 826 891 892 936 937 935 940 976