Displaying 20 results from an estimated 30000 matches similar to: "How to subset my dataframe? (a bit tricky)"
2009 Jun 16
3
How to extract all rows that contain the value of X in any column?
Hi R-helpers,
I'm trying to use this code
> pvh_dnv<-pvh[sapply(pvh=="dnv"),]
to make a new dataframe containing the rows from pvh that contain the
value of "dnv" in ANY column.
But, it's not working. I get this error
Error in match.fun(FUN) : element 1 is empty;
the part of the args list of 'is.function' being evaluated was:
(FUN)
which, to
2009 Jun 30
1
How to wrap my (working) code in a loop or function? (loop/function newbie alert)
Dear R-helpers,
I have split a dataframe into a list with five elements, with the following
code:
> datalist<-split(data,data$UNIT)
I would now like to run some code (below) on each element of the list to
extract rows from the list elements; then I would like to rbind the
extracted rows into a new dataframe containing all of the extracted rows
from all of the list elements.
I don't
2012 Feb 09
1
Apply pmax to dataframe with different args based on dataframe factor
# I have a dataframe in the following form:
track <- c(rep('A', 3), rep('B', 4), rep('C', 4))
value <- c(0.15, 0.25, 0.35, 0.05, 0.99, 0.32, 0.13, 0.80, 0.75, 0.60, 0.44)
df <- data.frame(track=factor(track), value=value)
#> print(df)
#track value
#1 A 0.15
#2 A 0.25
#3 A 0.35
#4 B 0.05
#5 B 0.99
#6 B 0.32
#7 B 0.13
2009 Jun 24
5
How to avoid ifelse statement converting factor to character
Hi R-helpers,
Please see the below R output.
The problem is that after running the ifelse statement, data$SOCIAL_STATUS
is converted from a factor to a character.
Is there some way I can avoid this conversion?
Thanks in advance, Mark Na
> str(data)
'data.frame': 2100 obs. of 11 variables:
$ DATE : Factor w/ 5 levels "4-Jun-09","7-May-09",..: 1 1 1 1 1
2003 Jan 23
1
subset dataframe based on rows
I want to subset the dataframe based on certain values in a row.
for each row in my dataframe
if ANY one value of a particular set of columns satisfies cond
append a logical value true at the end of the row
else
append a false at the end of the row
in the end I want to be able to subset the whole data based on the
appended true or false value.
I could literally code like this, but I think
2009 Oct 13
2
splitting dataframe, assign to new dataframe, add new rows to new dataframe
Hi, all,
My objective is to split a dataframe named "cmbine" according to the value of "classes". After the split, I will take the first instance from each class and bin them into a new dataframe, "df1". In the 2nd iteration, I will take the 2nd available instance and bin them into another new dataframe, "df2".
>cmbine$names
apple tiger pencil chicken
2006 Feb 08
1
Polycom IP501 MWI goes off periodically
I remember seeing something like this on the list a while ago, but I'm
darned if I can find it.
We have a number of Polycom IP501 phones, some of which have more than
one registration on them. When a voicemail is left for a phone with
only one registration, the MWI lights up and stays lit until the
voicemail is listened to.
However, on our phones with more than one registration, the MWI
2005 Dec 20
4
Got SUBSCRIBE for extensions without hint
Hi there,
I'm getting a bunch of these errors from Polycom phones in 1.2.1:
ERROR[24301]: chan_sip.c:10790 handle_request_subscribe: Got SUBSCRIBE
for extensions without hint. Please add hint to 4003 in context
internal
I've searched the Wiki and archives to no avail - what do these errors
mean?
Regards,
--
Anthony Rodgers
Business Systems Analyst
District of North Vancouver
Web:
2020 Apr 07
1
"failed to setup INTx fd: Operation not permitted" error when using PCI passthrough
Hi,
I'm on a Dell VEP 1405 running Debian 9.11 and I'm running a few tests with
various interfaces given in PCI passthrough to a qemu/KVM Virtual Machine
also running Debian 9.11.
I noticed that only one of the four I350 network controllers can be used in
PCI passthrough. The available interfaces are:
*# dpdk-devbind.py --status Network devices using kernel driver
2005 Aug 15
1
Maximum remote directory size in Polycom IP501
Greetings,
We are trying to make our corporate directory (around 400 entries)
available via TFTP to some Polycom IP501 phones. A small (~40 entries
or so) file works, but the full file fails to load. Does anyone know
what the upper limit on directory entries is?
The size of the XML file itself is only 60K - you'd think that would
all fit into the phone with no problems.....
I would
2006 Feb 09
1
SPA-3000 VOIP-PSTN gateway - longdelaybetweenanswering and ringing
You can even set it to zero. Mine works well when in zero. The line pick up immediately :>
-----Original Message-----
From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Chris Stenton
Sent: Thursday, February 09, 2006 6:57 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] SPA-3000 VOIP-PSTN
2009 Jun 23
2
Problem with ifelse statement
Hi R-helpers,
I am trying to use this ifelse statement to recode a variable:
> data$SOCIAL_STATUS<-ifelse(data$SOCIAL_STATUS=="B" & data$MALE>4, "C", "B")
(i.e., if social status is B and there are more than 4 males, then
recode social status to C; otherwise, leave it B)
But, it's not working. See the below R output. Notice that there were
71
2007 Feb 20
1
Difficulties with dataframe filter using elements from an array created using a for loop or seq()
Hi All-
This seems like such a pathetic problem to be posting about, but I have no
idea why this testcase does not work. I have tried this using R 2.4.1,
2.4.0, 2.3.0, and 2.0.0 on several different computers (Mac OS 10.4.8,
Windows XP, Linux). Below the signature, you will find my test case R code.
My point in this folly is to take a dataframe of 300,000 rows, create a
filter based on two
2005 Aug 16
4
Called Party Identification on Polycom IP501
Greetings,
The Polycom SIP 1.5 Admin Guide says this:
"3.1.8 Connected Party Identification
Where possible, the identity of the remote party to which the user has
connected is displayed and logged. The connected party identity is
derived from the network signaling. In some cases the remote party
will be different from the called party identity due to network call
diversion."
2007 Apr 16
2
indexing a subset dataframe
Hello
I am having problems indexing a subset dataframe, which was created
as:
> waspsNoGV<-subset(wasps,site!="GV")
Fitting a linear model revealed some data points which had high
leverage, so I attempted to redo the regression without these data
points:
>wasps.lm<-lm(r~Nt,data=waspsNoGV[-c(61,69,142),])
which resulted in a "subscript out of bounds" error.
I'm
2011 Aug 13
2
How do I subset a dataframe
I have a dataframe zeespan. One of the columns has the name "customer". The
data in the customer column is text. I would like to return a subset of the
dataframe with all rows that DON'T begin with either "ibm" or "exxon", or
"sears" in the customer column.
I tried .... subset(zeespan, customer != c("ibm" | "exxon" |
2006 Feb 08
6
dataframe subset
I have a dataframe with a column, say "x" consisting of values, each
value appearing different times, e.g.
x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
and a vector, including e.g.:
y: 2,9,10,...
I need a subset of the dataframe: all rows where x is equal to one of
the values in y. Currently I use a loop for this, but because x and y
are large this is very slow.
Is there any idea how to
2002 Jul 03
2
operating on a subset of a dataframe
Hi everyone,
I've got a dataframe with columns of different types. A certain number
of columns in the dataframe hold the results of a series of Likert-type
items. I've got a function that will print a simple table of frequencies
and I want to apply that function to those columns of the dataframe
only. What's the best approach?
-Tim
--
Tim Wilson | Visit Sibley online: |
2010 Dec 03
2
subset of a dataframe
HI,
I have a dataframe like this:
name type
A t1
B t2
C t1
D t1
E t3
F t2
how can I have a "sub dataframe" based with the column "type" like this:
(for type = t1)
name type
A t1
C t1
D t1
(for type = t2)
name type
B t2
F t2
Thanks
--
View this message
2009 May 26
2
Problem accessing "row number" from subset on a dataframe
I would like to use the "row number" information returned from performing a subset command on a dataframe.
For example, I would like to automatically delete some rows from a dataframe if they match a criteria. Here is my example below.
data(airquality)
names(airquality)
subset(airquality, airquality$Month == 6)
Now how do I delete the row numbers returned automatically?
I