Re: [R] Convert list of data frames to one data frame

2018-07-01 Thread Ira Sharenow via R-help
        )               )   ) } listFinal3 <- lapply( employees4List, myrename3 ) listFinal3 #> [[1]] #>  First1 Second1 #> 1    Al  Jones #> #> [[2]] #>  First1 Second1 First2 Second2 #> 1    Al2  Jones  Barb  Smith #> #> [[3]] #>  First1 Second1  First2 Second2 Fir

Re: [R] Convert list of data frames to one data frame

2018-06-30 Thread Ira Sharenow via R-help
= c(NA, -1L)) DF2 <- read.table( text = "Start              End John              Adams Thomas        Jefferson ", header = TRUE, as.is = TRUE ) DFL <- list( DF1, DF2 ) # DFNames is a set of unique identifiers DFL1 <- data_frame( .DFNames = sprintf( "DF%d", 1:2 )      

Re: [R] Convert list of data frames to one data frame

2018-06-30 Thread Ira Sharenow via R-help
ned just from a count of > rows (?nrow) of the original list. > > Apologies if I misunderstand or your query or your constraints make > this simple approach impossible. > > Cheers, > Bert > > > > Bert Gunter > > "The trouble with having an open mind is tha

Re: [R] Convert list of data frames to one data frame

2018-06-29 Thread Ira Sharenow via R-help
arbara", "Carol"), second3 = c("Jones", > "Smith", "Adams")), > data.frame(first4 = ("Al"), second4 = "Jones2")) > > ### > > dfbycol <- function(x) { >  x <- lapply(x, function(y)as.vector(t(as.matrix(y &g

[R] Convert list of data frames to one data frame

2018-06-28 Thread Ira Sharenow via R-help
I have a list of data frames which I would like to combine into one data frame doing something like rbind. I wish to combine in column order and not by names. However, there are issues. The number of columns is not the same for each data frame. This is an intermediate step to a problem and the

Re: [R] Connect to postgreSQL

2017-08-26 Thread Ira Sharenow via R-help
do know how to write SQL queries, having used SQL Server. On 8/26/2017 9:47 PM, John wrote: > On Sat, 26 Aug 2017 18:35:31 -0700 > Ira Sharenow via R-help wrote: > > Can you access the postgres database through psql or some other route? > Also, do you require a password to acce

[R] Connect to postgreSQL

2017-08-26 Thread Ira Sharenow via R-help
I am using RStudio Version1.0.143 on a Windows 7 machine. R version 3.4.0 I am trying to connect to a postgreSQL database with the following command, but I receive an error message that says my password is incorrect. Since I saved my password in a file, I think I remember it. I searched for a s

Re: [R] Change database in SQL Server using RODBC

2014-06-30 Thread Ira Sharenow
find a solution. Br. Frede Sendt fra Samsung mobil Oprindelig meddelelse ---- Fra: Ira Sharenow Dato:30/06/2014 16.42 (GMT+01:00) Til: Peter Crowther ,R list Emne: Re: [R] Change database in SQL Server using RODBC Thanks for everyone’s feedback. library(RODBC) con = odbcConnect

Re: [R] Change database in SQL Server using RODBC

2014-06-30 Thread Ira Sharenow
t("SQLServer2012") >orders3 = sqlFetch(con3, "sportsDB.dbo.sports") Error in odbcTableExists(channel, sqtable) : ‘sportsDB.dbo.sports’: table not found on channel On 6/30/2014 1:34 AM, Peter Crowther wrote: > On 30 June 2014 02:44, Ira Sharenow wrote: >> I wis

[R] Change database in SQL Server using RODBC

2014-06-29 Thread Ira Sharenow
I wish to query tables that are NOT in the default SQL Server 2012 database. At work I am using SQL Server 2012 and Windows 7. I tested the following on my home set up of Server 2012 and Windows 7. I am using RStudio. I wish to connect to several SQL Server 2012 databases from R. This page help

Re: [R] iconv question: SQL Server 2005 to R

2013-10-11 Thread Ira Sharenow
et.microsoft.com/en-us/library/bb330962%28v=sql.90%29.aspx *International Features in Microsoft SQL Server 2005* Generally, SQL Server stores Unicode in the UCS-2 encoding scheme. On 10/11/2013 2:43 AM, Milan Bouchet-Valat wrote: > Le jeudi 10 octobre 2013 à 21:45 -0700, Ira Sharenow a écr

Re: [R] iconv question: SQL Server 2005 to R

2013-10-10 Thread Ira Sharenow
o not think there are any NA values. I cleaned up the csv file from within Excel. Then read it into R > sum(is.na(workingDF)) [1] 0 Also the Excel COUNTBLANK function gave me zero. On 10/9/2013 11:33 PM, Prof Brian Ripley wrote: > On 09/10/2013 10:37, Milan Bouchet-Valat wrote: >> L

Re: [R] iconv question: SQL Server 2005 to R

2013-10-09 Thread Ira Sharenow
“.txt” 3) Open each file in excel using a comma as a delimitator. [You might change column B to text format or use “find and replace” to delete the spaces in the StockID.] On 10/9/2013 2:37 AM, Milan Bouchet-Valat wrote: > Le mardi 08 octobre 2013 à 16:02 -0700, Ira Sharenow a écrit : &

[R] iconv question: SQL Server 2005 to R

2013-10-08 Thread Ira Sharenow
A colleague is sending me quite a few files that have been saved with MS SQL Server 2005. I am using R 2.15.1 on Windows 7. I am trying to read in the files using standard techniques. Although the file has a csv extension when I go to Excel or WordPad and do SAVE AS I see that it is Unicode Tex

[R] Obtaining data from a different row of data frame

2013-09-21 Thread Ira Sharenow
I have a large data frame with 2,000 rows and 600 columns. I can write loops to solve a smaller problem, but I need a better strategy for this data frame. Below is a simple example with just two stocks. In the data frame, each row represents a trading day. The first column is dates. The next g

[R] Create a new column based on values in two other columns

2013-09-07 Thread Ira Sharenow
I am trying to add a column to a data frame. Each day for each stock I make a prediction for a future date. Then I need to compare my predictions to the actual values. So looking at the first row of data: For Stock A on 2011-01-01 I predicted that on 2011-01-02 the price would be 10.25. Now I

[R] Manipulate stock market data in R

2013-09-03 Thread Ira Sharenow
I am trying to manipulate data that an analyst has given me. What are the best possible libraries? I will have to solve many questions that another analyst will ask over time. The first is to compare predictions to actual prices. Predictions are made every day for every stock. For the last five

[R] Seasonal correlations

2011-07-06 Thread Ira Sharenow
I am an R newbie, and I am facing what is for me a challenging problem. I am trying to write functions to solve the following problems. It seems as though R offers so many options I am not sure how to approach the problem. I have a data frame with dates in the first column and returns in th

[R] Comparing two functions

2010-11-28 Thread Ira Sharenow
Hi. I am new to R and facing a problem that I cannot solve. I am writing some basic functions. Then I would like to have a master function that allows me to call one of the functions which I created, but I cannot figure out how to do so. Below is an example. The functions rnormIra and run