Displaying 20 results from an estimated 10000 matches similar to: "How can I ask R to skip the title when reading the data?"
2013 May 02
1
Problems with reading data by readWorksheetFromFile of XLConnect Package
Hi,
Attached are two datasheet to be read.
My raw data "130502temp.xlsx" contains numbers with ' symbols, and they
can't be read as numbers. Even if I copy and paste as numbers to form a new
file "130502temp_number1.xlsx", they could not be read smoothly.
1. How can I read the datasheet as numbers?
2. How can I treat the notation "-" as (1)
2013 Nov 04
3
Reading data from Excel file in r
Hi experts,
I want to read data from an excel data like this:
for the fifth column, from first row until 140 but only 1,3,5,7,.....139
(only 70 values),
How can I do it in R?
thanks
[[alternative HTML version deleted]]
2013 Apr 23
1
Questions on function "readNamedRegionFromFile" in XLConnect pacakge
Hi,
I have two questions on the function "readNamedRegionFromFile" in
XLConnect pacakge.
1.
In the documentation,
# multiregion xlsx file from demoFiles subfolder of package XLConnect
demoExcelFile <- system.file("demoFiles/multiregion.xlsx",
package = "XLConnect")
# Load a single named region into a single data.frame.
df
2012 Oct 01
2
Input and output of time series data - any function or packages that helps?
Hello,
I work with time series data. From time to time I run programs to
produce results that are in time series form (e.g., quarterly or monthly
data). After a few days I might need to access part of the results and to
run another program. Is there any function or package (like dataframe or
zoo?) that might help so that I don't need to copy the results manually to
a csv or xls file?
2012 Jul 27
2
How can I access the title of a table read via read.csv?
Hi,
I have a table which I can read via read.csv:
fx1<-read.csv(file="A_FX_M.csv", header=TRUE)
TIME REER NTD JPY GBP HKD
1 198001 124.26 36.030 237.96 2.263980 4.8366
2 198002 126.59 36.030 244.05 2.290426 4.8765
3 198003 128.33 36.026 248.62 2.206045 4.9960
4 198004 127.85 36.063 251.67 2.215330 4.9760
5 198005 124.40 36.050 228.35 2.302026 4.8891
6 198006
2011 Sep 15
2
Reading Parts of Excel Files (within a sheet)
Dear R Users,
I have to read data from many excel spreadsheets, all which have some
frustrating formatting (lots of titles, headers, etc.). I am trying
to work directly from source data and the number of the spreadsheets I
would have to go through make reformatting one by one a pain. I have
found lots of ways to read excel files, but my question is whether
there is a way to only read
2012 May 02
1
How can I read the "text" or "character string" from a txt file?
Hello,
I have a large number of time series, which needs to be transformed by
log or difference. Some of them are just processed by "level" (LV) without
any transformation. For that purpose, I produce a text file (.csv or .xls)
as follows:
DLN DLNDLN LV LV LV.......
How can I read the preceding strings so that I can easily access them,
i.e., S[1]=DLN, S[2]=DLN, S[3]=DLN,
2014 Aug 14
3
leer ficheros excel en R en Ubuntu
Hola,
Pensé que esto iba a ser trivial en R, pero me estoy encontrado muchos con
mi problema en internet, y que las soluciones ofrecidas no terminan de
funcionar.
Estoy intentando leer un fichero .xls en ubuntu con los siguientes paquetes
y nada:
require(RODBC)
conn = odbcConnectExcel("madrid.xls") # open a connection to the Excel file
sqlTables(conn)$TABLE_NAME # show all sheets
df =
2013 May 03
10
Why can't R understand if(num!=NA)?
I have a program, when I write
if(num!=NA)
it yields an error message.
However, if I write
if(is.na(num)==FALSE)
it works.
Why doesn't the first statement work?
Thanks,
Miao
[[alternative HTML version deleted]]
2012 Mar 15
2
Importing multiple worksheets from one Excle/ csv file into R
Dear R experts,
I am trying to import some data from some Excle files into R. My Excle file
contains about 50 sheets.
One solution I can think about is to convert my Excle file into csv file
first and then load data into R using 'read.csv'.
But it seems to me that 'read.csv' only supports reading one sheet (or 'one
file') each time, so that seems I have to create 50 csv
2012 Jul 27
2
How can I access an element of a string?
Dear Daniel and Jorge,
Thank you very much and it does help.
If I have a string "ABCD", how can I access the second element of the
string "B"? Thanks,
Miao
2012/7/27 Daniel Nordlund <djnordlund@frontier.com>
> > -----Original Message-----
> > From: r-help-bounces@r-project.org [mailto:r-help-bounces@r-project.org]
> > On Behalf Of jpm miao
2014 Aug 15
5
leer ficheros excel en R en Ubuntu
Hola,
@javier, me gustaría no tener que hacer nada de forma manual, ni por fuera
de r, rstudio. Es decir, el típico comando de linux que me convierta de xls
a csv prefiero no usarlo. Me gustaría hacerlo todo desde R.
@jorge ->
Con RODBC me salta ->
Error: could not find function "odbcConnectExcel"
Lo que creo que es inevitable en Ubuntu
2013 Apr 03
3
Generating a bivariate joint t distribution in R
Hi,
I conduct a panel data estimation and obtain estimators for two of the
coefficients beta1 and beta2. R tells me the mean and covariance of the
distribution of (beta1, beta2). Now I would like to find the distribution
of the quotient beta1/beta2, and one way to do it is to simulate via the
joint distribution (beta1, beta2), where both beta1 and beta2 follow t
distribution.
How could we
2012 Apr 12
4
Definition of "lag" is opposite in ts and xts objects!
Example:
Will ts objects be obsolete or modified?
> a [,1]
1983 Q1 2.747365190
1983 Q2 2.791594762
1983 Q3 -0.009953715
1983 Q4 -0.015059485
1984 Q1 -1.190061246
1984 Q2 -0.553031799
1984 Q3 0.686874720
1984 Q4 0.953911035> lag(a,4) [,1]
1983 Q1 NA
1983 Q2 NA
1983 Q3 NA
1983 Q4 NA
1984 Q1 2.747365190
1984 Q2
2016 Apr 26
2
How to print the frequency table (produced by the command "table" to Excel
Hi,
How could we print the frequency table (produced by "table") to an Excel
file?
Is there an easy way to do so? Thanks,
Miao
> df <- data.frame(x = 1:3, y = 3:1, z = letters[1:3])
> table(df[,c("y","z")])
z
y a b c
1 0 0 1
2 0 1 0
3 1 0 0
> test<-table(df[,c("y","z")])
> as.data.frame(test)
y z Freq
1 1 a
2012 Mar 12
3
A question on histogram - area much less than 1
Hello,
I have problem running the histogram function "hist". The area under the
histogram is much lower than 1. Could anyone tell me what the problem is?
Thanks,
(The total number of observation is 992 (close to 1000), so the
probability that 0<Y1<35 is approximately 0.277)
miao
rm(list=ls())
par(mfrow=c(1, 1))
Y <- cbind(matrix(35*0.5,1,277), matrix(35*1.5, 1, 146),
2012 Feb 17
4
How can I tabulate time series data (in RStudio or any other R editor)?
Hello,
I have a question on how to tabulate the time series data. I use
RStudio, but if can be done in any other R editor, it should work in
RStudio as well.
> a1<-11:22
> a1ts<-ts(a1, frequency=4, start=c(1978,1))
> a1ts Qtr1 Qtr2 Qtr3 Qtr4
1978 11 12 13 14
1979 15 16 17 18
1980 19 20 21 22
If I click the variable "a1ts" on the
2013 Apr 17
3
Transformation of a variable in a dataframe
HI,
I have a dataframe with two variable A, B. I transform the two variable
and name them as C, D and save it in a dataframe dfcd. However, I wonder
why can't I call them by dfcd$C and dfcd$D?
Thanks,
Miao
> A=c(1,2,3)
> B=c(4,6,7)
> dfab<-data.frame(A,B)
> C=dfab["A"]*2
> D=dfab["B"]*3
> dfcd<-data.frame(C,D)
> dfcd
A B
1 2 12
2 4 18
2013 Jun 11
2
How can we access an element in a structure
Hi,
I have a structure, which is the result of a function
How can I access the elements in the gradient?
> dput(test1)
structure(-1.17782911684913, gradient = structure(c(-0.0571065371783791,
-0.144708170683529), .Dim = 1:2, .Dimnames = list(NULL, c("x1",
"x2"))))
> test1[[1]]
[1] -1.177829
> test1
[1] -1.177829
attr(,"gradient")
x1
2012 Oct 15
2
Download a file from url
Hi
Download the xls file from this link
http://www.nseindia.com/content/fo/fii_stats_12-Oct-2012.xls
<http://www.nseindia.com/content/fo/fii_stats_12-Oct-2012.xls>
I tried this
---------------------------------------------------------------
library(XLConnect)
url = "http://www.nseindia.com/content/fo/fii_stats_12-Oct-2012.xls"
local.xls.file = tempfile()
download.file(url,