Displaying 20 results from an estimated 10000 matches similar to: "Reading Data"
2003 Oct 21
4
interactive prompts
Am using R on a Linux box and am currently writing an interactive R script.
1. How do I ask a user to press any key to continue ? I used a system call to
read but this only works if the Enter key is pressed:
print("Press any key to continue")
system("read")
2. How do I get a string input from the user? Would like to see an R function,
say askget():
delay =
2004 Mar 04
4
Command Line Programs
Hi,
I have recently started using R again (switched from MatLab) and have a question regarding programming. How can I set up a file that will run several lines of R code? For example, in Fortran and DOS this used to be done via a batch file, and in MatLab I would write the code and save it in a script file, e.g., Test.m.
An example of what I am trying to do is the following:
2004 Feb 24
5
Nonlinear Optimization
Hi,
I have been brought back to the "R-Side" from MatLab. I have used R in
graduate econometrics but only for statistics and regression (linear and
nonlinear). But now I need to run general nonlinear optimization.
I know about the add-in quadprog but my problem is not QP. My problem is a
general nonlinear (obj funct) with linear constraints.I know about the "ms"
and
2004 Mar 31
2
functions & paths
Hi,
I have a couple of quick questions regarding R.
1) I have a ".First" function that automatically loads the quadprog package into the workspace. The .First function resides in R and is only saved if I save the workspace. The exact function is as follows:
.First<-function()
{
library(quadprog)
}
Is there any way that this function can be saved outside of R? That is, is there
2002 Jul 31
7
exportData(foo,"foo.xls","EXCEL") for R ?
r-help,
Is there a package available for R which allows you to export data directly
to .xls, much like exportData(foo,"foo.xls","EXCEL") in S-PLUS ? If not, is
anyone working on this, or thinking about working on this?
I apologise in advance if this question has already been answered.
Many thanks,
Matthew
2003 Apr 07
1
filtering ts with arima
Hi,
I have the following code from Splus that I'd like to migrate to R. So far,
the only problem is the arima.filt function. This function allows me to
filter an existing time-series through a previously estimated arima model,
and obtain the residuals for further use. Here's the Splus code:
# x is the estimation time series, new.infl is a timeseries that contains
new information
# a.mle
2003 Oct 17
3
don't display rulers in image() command and script file input
Dear R experts,
1. How can I turn off the display of rulers in image() command?
2. Rather than typing my commands at the command line, how can I input a file
contents aside from doing a copy and paste operation?
Thanks in advance,
Ernesto Adorio
Math Department
University of the Philippines
Diliman
2010 Nov 29
2
R equivalent of Beaton's Sweep algorithm
I'm looking for an R equivalent of Beaton's (1964) Sweep algorithim for
partial inversion of a
matrix by pivoting.
It implemented in SAS/IML as sweep(matrix, indices), described here
http://support.sas.com/documentation/cdl/en/imlug/59656/HTML/default/langref_sect266.htm
and here for python
http://adorio-research.org/wordpress/?p=262
--
Michael Friendly Email: friendly AT yorku
2006 Sep 19
3
Reading a file in R
Dear R helpers,
I am trying to read a CSV file in R called EUROPE (originally an Excel
file which I have saved as a CSV file) using the command
EUROPEDATA <- read.csv("EUROPE.csv")
EUROPE.csv is basically a matrix of dimension 440*44, and has a line of
headers, i.e. each column has a name.
Using read.csv I can't load the data into R properly. Although the first
20 columns or
2006 May 12
1
X11 and vfonts modules on AIX 5.2
I am trying to get R-2.2.1 to pass make check on an AIX 5.2 at work (I know R-2.2.1 is not the latest release, but I encountered make errors in my attempts to install either R-2.3.0 or the R-patched_2006-05-10 on the version of AIX I am on. I will post those errors in a separate posting from this.)
So far, configure and make finish without error for R-2.2.1 using gnu make, gcc-4.1.0, and
2007 Aug 13
3
invert 160000x160000 matrix
Can R invert a 160000x160000 matrix with all positive numbers? Thanks a lot!
2007 May 10
3
Getting the last day of the month.
Hi,
Given a date, how do I get the last date of that month? I have
data in the form YYYYMM, that I've read as a date using
> x$Date <-
as.Date(ISOdate(substr(x$YearEnd,1,4),substr(x$YearEnd,5,6),1))
But this gives the first day of the month. To get the last day of the
month, I tried
> as.Date(as.yearmon(x$Date,frac=0))
But I don't get the last day of the month here. (Tried
2005 May 17
6
Samba compatibility with NetAPP filers.
We are running scripts using smbclient to get some data of NetAPP filer and we run into the output below. After doing some digging, I found that there
is a incompatibility between NetAPP Data ONTAP OS and samba. Is this still the case or there is a fix for it. We are running 3.0.10
Any ideas would be great
George
Client started (version 3.0.10).
Connecting to 169.177.18.109 at port 445
2006 Apr 24
5
DO NOT REPLY [Bug 3718] New: RSync should verify permission/time before commiting a change
https://bugzilla.samba.org/show_bug.cgi?id=3718
Summary: RSync should verify permission/time before commiting a
change
Product: rsync
Version: 2.6.5
Platform: Sparc
OS/Version: Solaris
Status: NEW
Severity: major
Priority: P3
Component: core
AssignedTo: wayned@samba.org
2006 Sep 27
2
Constrained OLS regression
Hello R helpers,
I am trying to do a linear OLS regression of y on two variables x1 and
x2. I want to constrain the coefficients of x1 and x2 to sum up to 1.
and therefore run a constrained OLS. Can anybody help with this? (I have
seen some answers to similar questions but it was not clear to me what I
need to do) - I have tried the lm function with offset but I must not
have used it properly.
2006 Jan 20
1
Passing variable arguments to functions
Hi,
Is there another way to pass arguments via a vector to arbitrary functions
as in the following code example without using a series of if else
statements?
f <- test(func, x, parms, fargs1, fargs2, ...)
{
# parms is a vector of parameters to func.
# ... is for use by f, not by func.
n <- length(parms)
if (n == 0) y <- func(x)
else if (n == 1) y <- func(x,
2004 Jul 02
3
Termination for Asterisk Users - Inter-Asterisk Exchange
Folks!
Netweb Group, Inc. fully supports connectivity to any Asterisk PBX systems you have and can provide A-Z termination with immediate effect.
Any volume is good enough for us, even an amount as small as $1.00 a day will do for us.
We will provide connectivity from our Softswitch IP 216.162.116.46.
If anyone is interested, add this to your Asterisk IPBX and then email me for setting up a
2007 May 14
6
Conditional Sums for Index creation
Hi,
Apologies for the long mail. I have a data.frame with columns of
price/mcap data for a portfolio of stocks, and the date. To get the
total value of the portfolio on a daily basis, I calculate rowSums of
the data.frame.
> set.seed(1)
> ab <- matrix(round(runif(100)*100),nrow=20,ncol=5)
> ab[1:5,4:5] <- NA
> ab[6:10,5] <- NA
> ac <- as.data.frame(ifelse(ab <=
2001 Jul 09
1
problem loading saved image
I had an open session working in R and I regularly save the image with
save.image(). However, after a period of inactivity of a few days. I quit
the session. Now, when I try to restart R and load the same image I get the
following result:
> load("y:/grm/sdata/.rdata1")
Error in load("y:/grm/sdata/.rdata1") : an xdr real data read error occured
Can someone explain the cause
2007 Apr 01
2
Reading user input
Hi there, this is a very easy question, i just cant seem to find a straight
answer- i need this one thing, then i can finish my project for this term.
I am making an interactive application with R where I get the user to input
numbers that the program then uses in the analysis. I have figured out a
lot of stuff, yet this is somehow hard to find the answer to: