Displaying 20 results from an estimated 4000 matches similar to: "help in merging"
2018 Jul 23
2
oddity in transform
Note the inconsistency in the names in these two examples.  X.Time in
the first case and Time.1 in the second case.
  > transform(BOD, X = BOD[1:2] * seq(6))
    Time demand X.Time X.demand
  1    1    8.3      1      8.3
  2    2   10.3      4     20.6
  3    3   19.0      9     57.0
  4    4   16.0     16     64.0
  5    5   15.6     25     78.0
  6    7   19.8     42    118.8
  >
2007 Nov 24
5
how to calculate the return?
Hi, R-users,
  data is a matrix like this
         AMR      BS      GE      HR      MO      UK   SP500
1974 -0.3505 -0.1154 -0.4246 -0.2107 -0.0758  0.2331 -0.2647
1975  0.7083  0.2472  0.3719  0.2227  0.0213  0.3569  0.3720
1976  0.7329  0.3665  0.2550  0.5815  0.1276  0.0781  0.2384
1977 -0.2034 -0.4271 -0.0490 -0.0938  0.0712 -0.2721 -0.0718
1978  0.1663 -0.0452 -0.0573  0.2751  0.1372 -0.1346 
2018 Jul 24
2
oddity in transform
The idea is that one wants to write the line of code below
 in a general way which works the same
whether you specify ix as one column or multiple columns but the naming entirely
changes when you do this and BOD[, 1] and transform(BOD, X=..., Y=...) or
other hard coding solutions still require writing multiple cases.
ix <- 1:2
transform(BOD, X = BOD[ix] * seq(6))
On Tue, Jul 24, 2018 at
2007 Sep 07
3
Delete query in sqldf?
Dear All,
Is sqldf equipped with delete queries? I have tried delete queries but
with no success.
Thanks in advance,
Paul
2024 Aug 27
1
transform
Am 27.08.24 um 11:55 schrieb peter dalgaard:
> Yes. A quirk, rather than a bug I'd say. One issue is that the internal logic of transform() relies on
> 
>      e <- eval(substitute(list(...)), `_data`, parent.frame())
>      tags <- names(e)
> 
> so untagged entries in ... will not be included.
... unless at least one is tagged:
R> transform(BOD, 0:5, 1:6)
   Time
2011 Apr 20
1
Sqldf INSERT INTO
Hi,
I am new to R and trying to migrate from SAS. I am trying to copy data from
one table to another table which have same columns using sqldf. but not
working and showing "NULL"
I wrote statement as sqldf("INSERT INTO new select * from data") but showing
NULL
Please help me in this regard.
Thank you
--
View this message in context:
2010 Jun 27
2
Ways to work with R and Postgres
Hi,
I post this message to the general r-help list hoping anyone within a wider range have suggestions:
 
There are three ways to integration R and postgres, especially on 64bit Microsoft windows Platform,
 
1. via RODBC package, which has 32 bit and 64 bit version for windows
2. via RPostgres interface, which only has 32bit version currently
3. via plr for Greenplum, which only supports a
2010 Dec 17
1
[Fwd: adding more columns in big.matrix object of bigmemory package]
Hi,
   With reference to the mail below, I have large datasets, coming from various
   different sources, which I can read into filebacked big.matrix using library
   bigmemory. I want to merge them all into one 'big.matrix' object. (Later, I
   want to run regression using library 'biglm').
   I am unsuccessfully trying to do this from quite some time now. Can you
   please
2017 Aug 10
2
Import selected columns from sas7bdat file
Hello everyone,
I want to import data from huge sas files with 100s of columns. The good
thing is that I am only interested in a few selected columns. Is there any
way to do that without loading the full dataset.
I have tried two functions: (1) read.sas7bdat *[from library 'sas7bdat']*,
and (2) read_sas *[from library 'haven']. *But couldn't find what I am
looking for.
Best
2008 Mar 25
5
reading Excel file
Hi R,
 
I have an excel file in which the third column is "date" and others are
"character" and "numeric".
Number of columns are 12
 
If I use this to read the file in R:   x = read.xls("D:\\file.xls")
 
The problem is that my date column is read in julian dates.
 
So I am using:                           x = read.xls("D:\\file.xls",
2009 Jul 15
2
Spaces in a name
I am reading regressors from an excel file (I have no control over the file)
and some of the element names have spaces:
i.e. "Small Bank Aquired"
but I have found that lm(SourceData ~ . - "Small Bank Aquired", mcReg)
doesn't work (mcReg = modelCurrentRegressors)
As they are toggles I have ran them through factor() to be treated propertly
as 0 or 1 but due to the fact I
2009 May 18
2
intermediate iterations of stepwise regression
Hi all,
I am performing a stepwise regression by running the "step" function on 
an "lm" object. Now I want to save the intermediate iterations. I know 
the argument trace=T will print it on the console, but I rather want to 
assign it to some R object or may be output it in a CSV or text file.
Any help will be appreciated.
Regards
Utkarsh
2012 Aug 20
1
function case in sqldf (datas from oracle) with a null value
I use sqldf to join 2 dataframes from 2 distinct databases : a and b come
from old sqldf's.
sqldf("select a.*, b.*, case a.QTY when null then b.QTY else a.QTY end as
NEW_QTY" 
from a inner join b on a.OBJECT=b.OBJECT")
R doesn't understand "when null". I tried with "when NA", "when '' ", "when
' ' " but it doesn't
2009 May 04
4
Splitting a vector into equal groups
Hi All,
I have vector of length 52, say, x=sample(30,52,replace=T). I want to 
sort x and split into five *nearly equal groups*. Note that the 
observations are repeated in x so in case of a tie I want both the 
observations to fall in same group.
This seems a very common task to do, but still I couldn't find an R 
function to do this. Any help would be highly appreciated.
Regards
Utkarsh
2008 Sep 09
2
How does predict.lm work?
Hi, 
  Please could someone explain how this element of predict.lm works?
From the help file 
`
newdata	  
An optional data frame in which to look for variables with which to
predict. If omitted, the fitted values are used.
' 
  Does this dataframe (newdata) need to have the same variable names as
was used in the original data frame used to fit the model? Or will R
just look across consecutive
2009 Jun 02
2
bigmemory - extracting submatrix from big.matrix object
I am using the library(bigmemory) to handle large datasets, say 1 GB, 
and facing following problems. Any hints from anybody can be helpful.
_Problem-1:
_
I am using "read.big.matrix" function  to create a filebacked big matrix 
of my data and get the following warning:
 > x = 
read.big.matrix("/home/utkarsh.s/data.csv",header=T,type="double",shared=T,backingfile
2017 Aug 10
1
Import selected columns from sas7bdat file
hi, the sas universal viewer might be a free, non-R way to convert a
sas7bdat file to non-proprietary formats, not sure if it's windows-only.
those other formats should be easier to import only a subset of columns
into R..
https://support.sas.com/downloads/browse.htm?fil=&cat=74
On Thu, Aug 10, 2017 at 7:42 AM, peter dalgaard <pdalgd at gmail.com> wrote:
> I had a look at this
2011 Jan 17
4
Extraction and replacement of data in a data frame
Dear R family,
I am a relative newbie and have been dabbling with R for a little while. 
Simple things really, but my employers are beginning to see the benefits of
using R instead of excel. We have a remote monitoring station measuring
groundwater levels.  We download the  date as a .csv file and up until now,
we have been using excel to analyse the data.  It?s been a hassle trying to
wrestle
2011 Apr 18
2
help with eval()
I've narrowed my scope problems with predict.coxph further.
Here is a condensed example:
fcall3 <- as.formula("time ~ age")
dfun3 <- function(dcall) {
    fit <- lm(dcall, data=lung, model=FALSE)
    model.frame(fit)
}
dfun3(fcall3)
The final call fails: it can't find 'dcall'.
The relevant code in model.frame.lm is:
       env <- environment(formula$terms)
2017 Aug 10
0
Import selected columns from sas7bdat file
I had a look at this a while back and it didn't seem to be easy. The path of least resistance would seem to be to use SAS itself to create a data set with fewer columns, but of course that requires you to get access to SAS. 
Otherwise, I think you'd have to modify sas7bdat::read.sas7bdat to drop unselected columns. That function is pure R code, so it might not be quite as hard as it