similar to: rbind.data.frame drops attributes for factor variables

Displaying 20 results from an estimated 10000 matches similar to: "rbind.data.frame drops attributes for factor variables"

2011 Nov 12
1
With an example - Re: rbind.data.frame drops attributes for factor variables
When I use rbind() or rbind.data.frame() to add a row to an existing dataframe, it appears that attributes for the column of type "factor" are dropped. See the sample example below to reproduce the problem. Please suggest How I can fix this. Thanks, Sammy a=c("Male", "Male", "Female", "Male") b=c(1,2,3,4) c=c("great", "bad",
2011 Nov 24
3
Is there way to add a new row to a data frame in a specific location
Is there easy way (without copying the existing rows to a temporary location and copying back) to add a new row to a specific index location in an existing data frame? Example df = data.frame( A= c('a','b','c'), B=c(1,2,3), C=(10,20,30)) newrow = c('X', 100, 200) I want to add the newrow as the second row to the data frame df Please suggest a solution that is
2008 May 21
0
rbind.data.frame drops attributes for factor variables
Dear R-devel - I noticed that when I rbind two data.frames together, factor variables lose their attributes in the resulting data.frame while numeric variables do not. As an example, create two data.frames, t1 and t2, with two variables each. Give each variable an attribute called "label", and then perform the rbind and look at the resulting structure. #### EXAMPLE R CODE #####
2003 Feb 04
1
pulling tree : semantics problem
Hi, I'm trying to pull my home from a remote machine. I get a error 'failed to set permissions on home : Not owner' which is obvious: rsync -a remote:/home/foo/bar/zee / this create /home/foo/bar/zee here , but give above error I don't own /,/home but i own /home/foo/bar and lower. If i tell rsync to: rsync -a remote:/home/foo/bar/zee /home/foo/bar it creates
2007 Jun 10
1
Setup problems, /dev/net/tun FD in bad state
Hi all, I'm following the manual but I get the below error, and I believe tinc is clobbering my conf file. I've never set up VPN before, I'm just trying to connect to my work network from home. All the following is on my work computer. Thanks in advance for any help. $ ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:1A:A0:17:3A:50 inet addr:172.24.104.145
2011 Oct 10
1
Converting factor into date
Dear R users, I have an elementary query. I have a dataset which is taken from text file with the help of read.csv command but when I generate the data in R file it converts the Dates into factor.So for the above problem, I use as.Date to convert the Dates from factor form to date format using the following: z has Date as a column. *z<- read.csv("data", header = TRUE, sep =
2009 Nov 11
1
lm and levels
Consider the following example: x <- c(2,4,3,6) y <- c(4,9,5,10) z <- factor(c(1,1,2,2)) summary(lm("y ~ x + z")) The above works fine. Suppose I change z so that x <- c(2,4,3,6) y <- c(4,9,5,10) z <- factor(c(1,1,2,NA)) summary(lm("y ~ x + z")) the last row/observation is not considered in the regression. I would like this to be treated as z with two
2012 Feb 28
1
Alphanumeric DTMF !?
Hi list, What possibilities are there in asterisk to send an *alphanumeric DTMF*from/to asterisk !? Regards, Sammy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120228/e62e7890/attachment.htm>
2013 Oct 27
2
numeric data being interpreted as a factor -trouble with reading data into a dataframe in R
Hello. trying to do one of the simplest actions -read in data into R. I don't know why the FBfollowers column is being read as a factor and also if I use as.numeric on it, it looks really strange and actually complety alters the data. I am attaching the data set here called ddd.csv I used data=read.csv("ddd.csv",header=TRUE) fb=data$FBfollowers fb fb=as.numeric(fb) fb Thnxs in
2011 Dec 28
1
subset() missing one factor
The data set (called 'chemdata') has 6 columns (4 factors, 1 date, 1 numeric) and I need to create subsets for each of one of the factors ('stream'). This has worked flawlessly for all but two streams which were created yesterday. The command I use to create the subsets is like this: > rnchH <- subset(chemdata, stream == 'RanchSpgsH', select = c(site, sampdate,
2011 Aug 18
2
Selecting subset of factor levels
Dear r-help, I would like to select a subset of levels from a factor variable in a data frame and return a data frame. The data set consists of 3 variables, 2 of which are factors (Site, Fish) and one numeric (Datavalue) as follows: Site Fish Datavalue AB 2-1 2.3 AB 2-1 2.4 AB 2-1 2.2 AB 2-2 2.6 AB 2-2 2.5 AB 2-2 2.7 AB 2-3
2011 Nov 09
2
algorithm that iteratively drops columns of a data-frame
Dear R-Users, I have a problem with an algorithm that iteratively goes over a data.frame and exclude n-columns each step based on a statistical criterion. So that the 'column-space' gets smaller and smaller with each iteration (like when you do stepwise regression). The problem is that in every round I use a new subset of my data.frame. However, as soon as I "generate" this
2012 Feb 11
1
Asterisk perl AGI confusing variables
Hello all, I'm struck with a very strange problem today. I've an AGI with some code subroutine snippet as follows: sub enable_sbc($) { my $carrier = shift; my $tmp = substr($carrier,1); my $jkh = $tmp; $server_port = $ast_agi->get_variable("SIPPEER($jkh,port)"); $ser_ip = $ast_agi->get_variable("SIPPEER($tmp,ip)");
2011 Dec 29
2
sorting a data.frame (df) by a vector (which is not contained in the df) - unexpected behaviour of match and factor
Dear R colleagues, consider my data.frame named "df" with 3 columns - being level, prevalence and sensitivity - and 7 rows of data (see dump below). df <- structure(list(level = structure(1:7, .Label = c("0", "1", "10", "100", "1010", "11", "110"), class = "factor"), prevalence = structure(c(4L, 2L, 3L,
2012 Jan 14
1
Asterisk as UAC: How to put call OnHold
Hi! Maybe I am missing something or am a little blind at the moment, but I didn't find out how asterisk can place a call on hold when acting as user agent client to another SIP server. Scenario: ---------- Asterisk registers to another SIP server (provider) as user agent. An inbound call from this other SIP server comes in and arrives at asterisk. Asterisk performs some actions in the
2009 Dec 17
2
multiple usb apc smart ups with nut?
Hello everybody, I got tree UPS devices connected to a Debian server, and i am searching for a way to configure them. The server power-cord is only connected to one of the ups devices, and should monitor the other ups systems to sent email status. I got a HP R3000XR UPS with has a RS232 communication port that I have working perfectly. Then I have two APC SmartUPS 750V devices that are
2012 Feb 16
2
Asterisk && RTCP
Hello list, I need to know about Asterisk's friendly nature with RTCP. I've phones which support RTCP and they connect to the outer world via multiple carriers. In one of my recent packet traces I've observed that the caller initiated a call with rtcp string in SDP while for the same call dialling our from Asterisk to the carrier has no RTCP string in SDP ! Can anyone please tell why
2005 May 16
2
Broadvoice Toll-Free IVR issues
Perhaps someone else has had this issue. I currently have BroadVoice as my SIP provider with two phone numbers. The first number is my primary local number; the second is an 877 toll-free number. The issue is with the IVR abilities. When calling the primary number you can press 200 at the main menu and receive my extension. When calling the 877 number, 200 will result in ?that option is invalid?
2011 Dec 23
1
execute command just after Dial()
Hello, I'm using AGI scripting with asterisk and need to execute certain commands just after Dial(). But once dial command is executed, further commands/instructions are ignored. $agi->exec("Dial","SIP/100"); $dialstatus = $agi -> get_variable("DIALSTATUS"); if($dialstatus[data]=="ANSWER") { do something.......
2011 Dec 14
1
get start-time of all active calls
Hello, asterisk version 1.6.2.7 I want to get the start time of all active calls from console, could you please let me know the best way to get it. thanks, Kamlesh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111214/b462516a/attachment.htm>