Displaying 20 results from an estimated 10000 matches similar to: "a generic 'attach'?"
2017 Jun 26
2
Odd behaviour in within.list() when deleting 2+ variables
The behaviour of within() with list input changes if you delete 2 or more variables, compared to deleting one:
l <- list(x=1, y=2, z=3)
within(l,
{
rm(z)
})
#$x
#[1] 1
#
#$y
#[1] 2
within(l, {
rm(y)
rm(z)
})
#$x
#[1] 1
#
#$y
#NULL
#
#$z
#NULL
When 2 or more variables are deleted, the list entries are instead set to NULL. Is this intended?
2017 Jun 26
2
Odd behaviour in within.list() when deleting 2+ variables
>>>>> peter dalgaard <pdalgd at gmail.com>
>>>>> on Mon, 26 Jun 2017 13:43:28 +0200 writes:
> This seems to be due to changes made by Martin Maechler in
> 2008. Presumably this fixed something, but it escapes my
> memory.
Yes: The change set (svn -c46441) also contains the following NEWS entry
BUG FIXES
o
2017 Apr 12
3
"table(droplevels(aq)$Month)" in manual page of droplevels
The last line of the example in droplevels' manual page seems to be incorrect to me. I think it should read: "table(droplevels(aq$Month))". Amazingly (I don't understand) both variants seem to produce the same result (R 3.3.3):
---
> aq <- transform(airquality, Month = factor(Month, labels = month.abb[5:9]))
> aq <- subset(aq, Month != "Jul")
>
2008 Sep 25
2
Equivalent of 'first.var' or 'last.var' from SAS in R?
Hi,
I want to sort a data frame by multiple columns and then take the
first record in each unique level of the "by" group I used to sort the
data frame. Does someone have an example of how to do this?
Thanks,
Matt
--
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas
2009 Jun 05
3
help with duplicates
I have a large dataset that contain duplicate records. How do I identify and remove duplicate records?
Chris Anderson
707.315.8486
www.sassydeals4u.com
____________________________________________________________
Free info for small business owners. Click here to find great products geared for your business.
2017 Apr 12
2
"table(droplevels(aq)$Month)" in manual page of droplevels
Hello,
Inline.
Em 12-04-2017 16:40, Henric Winell escreveu:
> (Let's keep the discussion on-list -- I've added back R-devel.)
>
> On 2017-04-12 16:39, Ulrich Windl wrote:
>
>>>>> Henric Winell <nilsson.henric at gmail.com> schrieb am 12.04.2017
>>>>> um 15:35 in
>> Nachricht <b66fe849-bb8d-f00d-87e5-553f866d57e0 at gmail.com>:
2008 Dec 02
4
Bug in "transform"?
Dear useRs,
Here is a weird behavior of transform function:
mtcars1<-matcars
transform(mtcars1,t1=3,t2=4)
Error in data.frame(`_data`, e[!matched]) :
arguments imply differing number of rows: 32, 1
instead, this works:
mtcars1$t1<-0
transform(mtcars1,t1=3,t2=4)
also works if applied in turn:
transform(mtcars1,t1=3)
transform(mtcars1,t2=4)
I often need to use this
2011 Jan 18
3
tips for looping over a category for beginner
hello, I am very new to R.
My current data set is a mix of values and categories. It is a geoscience
data set, with values per rock sample. Case in point, each sample belongs to
a lithology class, and each sample has several physical property
measurements (density, porosity...).
I want to be able to plot these physical properties for all samples in each
lithology class. this is how i'm doing
2018 Apr 22
3
How to dynamically add variables to a dataframe
Hi,
I am a bit rusty with R programming and do not seem to find a solution to
add a number of variables to my existing dataframe. Basically I need to add
n=dim(d1)[1] variables to my d0 dataframe and I would like them to be named
V1, V2, V3, ... , V[dim(d1)[1])
When running the following code:
for (t in 1:dim(d1)[1]){
d0$V[t] <- 0
}
all I get is a V variable populated with zeros...
I am
2004 Feb 24
6
be careful: using attach in R functions
Hi there,
I have just found that the ``attach'' function
can get you into trouble when called many times.
For example, you have a simulation routine called ``f()'',
in which you used ``attach'' and no corresponding ``detach''.
Then you call this function many times. You will find that
the system performance get slower and slower,
because you are making the R
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
2009 Aug 04
5
Stacked plots with common x-axis and different y-axis
Is there a place that shows how to create two plots that are stacked on top of each other where they share a common x-axis scale, but have differnt y-axis scale?
Say have the following data: airquality
Stack plot(airquality$Day, airquality$Wind) on top of plot(airquality$Day, airquality$Temp).
I am interested in stacking the two on top of each other with no seam, or plotting the two lines with
2009 Sep 06
1
IVT SCD support status
Rainer, Arjen
I was wandering around the code, and found that few things are missing
around the IVT code:
- no manpage,
- no entry in driver.list
- no device{mfr,model,type} in the code.
I was about to submit a patch to address the above (ready to commit), but
wanted first to get an update on the status. looking at the last thread,
it's a bit unclear... I'm also interested an upsc
2008 Dec 23
3
Using transform to add a date column to a dataframe
I would like to add a column to the airquality dataset that contains the date
1950-01-01 in each row. This method does not appear to work:
> attach(airquality)
> data1 <- transform(airquality,Date=as.Date("1950-01-01"))
Error in data.frame(list(Ozone = c(41L, 36L, 12L, 18L, NA, 28L, 23L, 19L, :
arguments imply differing number of rows: 153, 1
I can't decipher what
2010 Apr 19
1
Attach CDROM to windows
Hi Guys,
Now I am using Xen-4.0.0. I need to attach CDROM from ISO files to vitual
machines when they are running. The VMs contain RHEL4.6, Windows Server 2003
32bit and Windows Server 2006 64bit.
The disk configuration of the VMs is:
disk = [ ''tap:vhd:/guest/SS_test/vhd/hmi-100130.vhd,hda,w''] (1)
When I attach a CDROM to RHEL4.6 VM with the command:
virsh
2010 Apr 19
1
Attach CDROM to windows
Hi Guys,
Now I am using Xen-4.0.0. I need to attach CDROM from ISO files to vitual
machines when they are running. The VMs contain RHEL4.6, Windows Server 2003
32bit and Windows Server 2006 64bit.
The disk configuration of the VMs is:
disk = [ ''tap:vhd:/guest/SS_test/vhd/hmi-100130.vhd,hda,w''] (1)
When I attach a CDROM to RHEL4.6 VM with the command:
virsh
2012 Jul 23
1
INTERNAL ERROR:can not attach network interface for vm
hello,i got a error message when use virsh attach-interface for a vm:
first, list the vm's interface,there's no interface now.
virsh # domiflist ubuntum-124
Interface Type Source Model MAC
-------------------------------------------------------
then,i did an attach-interface action:
virsh # attach-interface ubuntum-124 bridge br0 --persistent
Interface attached
2005 Dec 09
3
[R] data.frame() size
Hi,
Please see below for post on r-help regarding data.frame() and the
possibility of dropping rownames, for space and time reasons.
I've made some changes, attached, and it seems to be working well. I see the
expected space (90% saved) and time (10 times faster) savings. There are no
doubt some bugs, and needs more work and testing, but I thought I would post
first at this stage.
Could some
2008 Aug 06
1
bug submitting bug? [Fwd: Undelivered Mail Returned to Sender]
(A) I received the following bounced message when I tried to submit a
bug from http://bugs.r-project.org/cgi-bin/R
(B) The bug report itself is at the bottom.
Thanks,
Chris
(A)
-------- Original Message --------
Subject: Undelivered Mail Returned to Sender
Date: Wed, 6 Aug 2008 17:08:02 +0200 (CEST)
From: MAILER-DAEMON at pubhealth.ku.dk (Mail Delivery System)
To: candrews at buffalo.edu
2005 Jul 01
2
Simple indexing conundrum
My apologies in advance for my thickness but I can't seem to solve the
following, seemingly simple, data manipulation problem:
I have a data frame that contains multiple factors and multiple
continuous response variables, but duplicates of some factor
combinations. The duplicates contain bad data, so I would like to
eliminate the duplicates. I would like to retain the entire rows