similar to: how to add a column from another dataset with "merge"

Displaying 20 results from an estimated 200 matches similar to: "how to add a column from another dataset with "merge""

2011 Jan 31
4
Select rows with distinct values in a column and other conditions
My data frame looks like: SightingID PA1 PA2 PlotID InOverlap Area1 2001 1 -99 392 Y 0.22 2002 1 -99 388 Y 0.253 2008 1 NA 104 N 0.344 2010 1 NA 71 N 0.185 2012 1 NA 61 N 0.166 2013 1 NA 61 N 0.227 2014 1 NA 62
2010 Mar 19
1
Sweave and " object of type 'closure' is not subsettable" error
Hello folks: I have a data frame which includes two numeric vectors: "Pa1" and "Ingr" (which represents income).  I run the following code on the R console: ingreso <- factor(ifelse(Ingr<=3000,"bajo","alto")) tapply(Pa1,ingreso,summary) boxplot(Pa1~ingreso) and it works fine.  However, when I "Sweave" through an rnw file containing that
2011 Jan 20
4
How to reshape wide format data.frame to long format?
Dear list, I need to convert this data.frame > names(codesM) [1] "key" "AMR.pa1.M" "AMR.pa2.M" "AMR.pa3.M" "AMR.pa4.M" [6] "AMR.pa5.M" "AMR.pa6.M" "AMR.pa7.M" "AMR.pa8.M" "AMR.pa9.M" [11] "AMR.pa10.M" "AMR.ta1.M" "AMR.ta2.M" "AMR.ta3.M"
2009 Apr 15
2
How to extract p-value into a table from a groups of t test
Hi, I have run a groups of t test and obtained a list of the t-test results (about 30). How do I extract p-values from the 30 t-test results and make a table output? Thanks Jun Example t-test output: ============================ $Lambda_z Welch Two Sample t-test data: x[PA1.BS.DN$Onecode == 2] and x[PA1.BS.DN$Onecode == 3] t = -0.1128, df = 33.635, p-value = 0.9109 alternative
2008 May 21
2
Search a string and modify it in a .txt file
Hi there, I use R and I would like to be able to modify a file .txt "init_file" like this one : # ---------------------------------------------------------------------------- # # Parameters A # ---------------------------------------------------------------------------- # # Parameter 1 PA1 = 15 # Parameter 2 PA2 = 3 # Parameter 3 PA3 = 2 #
2009 Aug 01
2
Add columns in a dataframe and fill them from another table according to a criteria
Deare R users I am new to R. What I want to do is explained below;- I have table called States.Prob which is given below:- This table gives the probabilities of the changes in the swap curve depending on the state of the swap curve. I want to put these probabilities in my dataframe mydata(given after the prob table). Prob of States Changes State1 State2 State3 State4 a
2009 Apr 29
1
R Macro Question
Dear all, I am a new R user, and I have a question about R macro. Here is the situation, I want to do item option analysis (options include: A , B, C, D), below is the codes for option A analyses. #option A analyses optiona<-mat.or.vec(nrow(responsedata2), ncol(responsedata2)) # create A matrix by recoding for (i in 1:ncol(responsedata2)){    
2009 Jul 31
1
Fill dataframe from a table according to a criteria
Deare R users I am new to R. What I want to do is explained below;- I have table called States.Prob which is given below Prob of States Changes State1 State2 State3 State4 A Pa1 Pa2 Pa3 Pa4 B Pb1 Pb2 Pb3 Pb4 C Pc1 Pc2 Pc3 Pc4 D Pd1 Pd2 Pd3 Pd4 and I have a dataframe called
2009 Jul 23
1
ggplot2 : commands on one line vs two lines.
I have just started using ggplot2 and I seem to be doing something stupid in writing ggplot2 commands on more than one line. In the example below the commands on one line are working fine, but as soon as I put them on two lines I get an error. Can any one point out what I am doing wrong? It must be something blindingly simple. Thanks Example
2011 May 26
2
zoo column names
I have a zoo object that contains 2 time series named "A-B" and "V1". When I create a third series "V2", the name of the "A-B" series is changed to "A.B". Although I could recreate the names for the 3 series I am wondering if there is a way of preventing the name change from happening ( ... maybe an equivalent of the keep.names=TRUE statement
2012 Mar 01
2
Problems downloading file
I am running the following line to download data from the US Energy Information Administration. This function has worked successfully for me in the past but yesterday gave the error/warning messages below. If I simply type "http://ir.eia.gov/wpsr/psw09.xls" (no quotes) into a browser, the file is available to download. I am running R 2.13.0 on Windows XP. # Download File Attempt
2009 Jun 11
2
Optimization Question
Hi All Apologies if this is not the correct list for this question. The Rglpk package offers the following example in its documentation library(Rglpk) ## Simple mixed integer linear program. ## maximize: 3 x_1 + 1 x_2 + 3 x_3 ## subject to: -1 x_1 + 2 x_2 + x_3 <= 4 ## 4 x_2 - 3 x_3 <= 2 ## x_1 - 3 x_2 + 2 x_3 <= 3 ## x_1, x_3 are non-negative integers ## x_2 is a non-negative real
2011 Dec 22
2
Renaming Within A Function
I am trying to rename column names in a dataframe within a function. I am seeing an error (listed below) that I don't understand. Would be grateful of an explanation of what I am doing wrong and how I should rewrite the function to allow me to be able to rename my variables. Thanks. # Test Function myfunc <-function(var){ d = c(1,2,3,4,5) dts =
2015 Feb 19
0
snom devices specifically PA1
I have a snom PA1, works fine. I am trying to get it work with multicast and asterisk 11.16 my other devices are accepting multicast. When I enable multicast on the browser interface and enter the IP: port it works. However - when I enter that data on the TFTP config file - it is not present. I used the setting tab - export the config file, used that file and other settings work - like the
2010 Nov 15
7
Door Contacts via Asterisk?
Hi all, I have had (what I consider) an odd request. The installation I'm working on now is an office on a multi-floor building. They 're looking for some kind of solution with the phone system to provide door control. We are a non-profit so of course I'm looking for something VERY inexpensive. I'm sure /someone/ has done something like this. I'd appreciate any ideas. Cassius
2005 Nov 16
5
"Warning message: package '...' was built under R version 2.3.0"
Hi, While installing precompiled packages I often get warnings like the one in the subject. I usually ignore them, but I still do not understand why windows packages are build with unreleased versions of R. Is there some way to get packages build under R-2.2.0? What are potential problems that can result from that version mismatch? My system: winXP R version: 2.2.0 Jarek Tuszynski
2009 Jul 15
0
Fwd: DLLs
Thanks for your help with this problem about dynamic linked libraries. I thought I had it solved, but apparently not. Below is a small piece of Pascal code that I compile into a library. When I load the library using dyn.load R becomes very unstable. The Mac GUI crashes in all kinds of situations --even moving a window can sometimes crash it. Running from the command line (I thought the
2009 Oct 09
2
lm output
Hi All I am running a linear regression using the lm object. In the event that my independent variable is the same across all observations the regression slope is returned as an NA. For example, if I have the following y=c(10,12,17) x=c(5,5,5) lm = lm(y~x) produces the following Coefficients: (Intercept) x 13 NA Other than post-processing the results, is
2003 Dec 26
2
OC curve in "Quality Control"
Dear all, Can anyone please help me about any of the following questions: -------------------------------------------- 1. How can i find "factorial" of any number in R? I tried > prod(170:1) # to find factorial of 170 or 170! Is it the only procedure - or R has any better process / operational character to calculate factorial? Also, is it possible to calculate factorial of 500? Or
2011 Jan 15
2
Rounding variables in a data frame
Hi All I am trying to use the round function on some columns of a dataframe while leaving others unchanged. I wish to specify those columns to leave unchanged. My attempt is below - here, I would like the column d3 to be left but columns d1, d2 and d4 to be rounded to 0 decimal places. I would welcome any suggestions for a nicer way of doing this. d1= rnorm(10,10) d2= rnorm(10,6) d3=