Well don't I feel silly now.
Thanks for the help!
--
View this message in context:
http://r.789695.n4.nabble.com/Suppressing-the-Intercept-in-lm-when-using-a-dataframe-for-the-model-tp3910327p3910443.html
Sent from the R help mailing list archive at Nabble.com.
_
It's easy to run a linear regression on a simple model without an intercept
just by doing this:
lm(y ~ x1 + x2 -1)
Is there a similar trick to suppress the intercept when your model is in a
large dataframe and you don't want to write out the names of individual
columns?
--
View this message in
Is there a quick and easy way to write data frames side-by-side in a csv file
with one column separating them?
I could just fill them with empty rows so they all have the same height,
then cbind them with empty columns in between, but I'm looking for a more
elegant solution, if one exists.
Than
It's just a typo.
You're missing a comma at the beginning of your index, and you should list
all of the rows in a vector, like this:
data[, c(19:27, 1:12, 13:15, 16:18)]
The way you entered it, R is looking for rows 19:27, columns 1:12, and
doesn't know what to do with the other numbers.
--
View
I should probably point out that in the example, "ecov_xy " and "decay" are
scalars, and x and y are vectors.
--
View this message in context:
http://r.789695.n4.nabble.com/What-does-the-operator-mean-tp3466657p3466672.html
Sent from the R help mailing list archive at Nabble.com.
__
I've been reading some code from an example in a blog post (
http://www.maxdama.com/ here ) and I came across an operator that I hadn't
seen before. The author used a <<- operator to update a variable, like so:
ecov_xy <<- ecov_xy+decay*(x[t]*y[t]-ecov_xy)
At first I thought it was a mistake and
I have a vector of character strings that I would like to split in two, and
place in columns of a dataframe.
So for example, I start with this:
beatles <- c("John Lennon", "Paul McCartney", "George Harrison", "Ringo
Starr")
and I want to end up with a data frame that looks like this:
> Beatles
The dirname() function looks very helpful; I hadn't heard of that one before.
I'm still reading up to see how the parent.frame command does what it does;
I didn't realize that the ofile variable might not be around in the future.
Richard's suggestion -- source("c:/myfullpath/myfile.r", chdir=T
Thanks, Gabor! So far I like this one best:
https://stat.ethz.ch/pipermail/r-help/2005-November/082347.html
So if my script is called "myRscript.r", I can do the following:
this.file = parent.frame(2)$ofile
this.dir = gsub("/myRscript.r", "", this.file)
setwd(this.dir)
This will set the work
So it sounds like the best we can do in R is to keep track of the script in a
sort of master file that runs the script, and set the working directory in
the master. Is that accurate?
In Python any time you run a script, there is a built-in "__file__" variable
that can tell you the file name of t
Basically I'm just looking for a command that can look up the name of the
directory of the script that is running. If I move or copy the script to
another directory, it should be able to read the name of the new directory
without me having to edit the code.
Once I have identified the directory,
Hello everyone,
This should be an easy question, I think.
I'd like to write a command in a program to set the working directory to
whatever directory the file is currently stored in. Suppose I have a file
called "myRscript.r", and it's stored in "C:\Rprojects\myRscript.r", and it
references ot
Hi everyone, I have a very quick question:
Is there a ready-made function in R or any R packages to find the prime
factorization of an integer?
--
View this message in context:
http://r.789695.n4.nabble.com/Prime-Factorization-tp2548877p2548877.html
Sent from the R help mailing list archive at
I'm running R 2.11.0 on a 32-bit Windows XP machine. Whenever I try to write
a csv file with 'append' set to TRUE, I get this message: attempt to set
'append' ignored.
Obviously, this is no good, since R is deleting my previously saved data
files, rather than appending to them. What can I do to
Thanks for the tip. From the link you posted:
| You can embed the user id and password into the URL. For example:
|
| http://userid:passw...@www.anywhere.com/
| ftp://userid:passw...@ftp.anywhere.com/
I'm still having issues, though. I am trying to fetch some csv files from a
storage site us
Hello everyone,
Is it possible to download data from password-protected ftp sites? I saw
another thread with instructions for uploading files using RCurl, but I
could not find information for downloading them in the RCurl documentation.
I am using R 2.11 on a Windows XP 32-bit machine.
Thanks
True, but all he said was that he wanted to auto-launch his program by
double-clicking it.
I don't know of any ways to speed up R other than to write the slower
functions in C and then call them in your R programs. But I'm not
sure that's what he had in mind.
On Mon, Jun 14, 2010 at 9:19 PM,
In Python, it is literally this easy:
import rpy2.robjects as robjects
robjects.r("""
source("C:/YOUR R FILE GOES HERE ")
""")
Type the name of your R source code into this script and save it as a Python
script (add the suffix .py), and then you can run by double-clicking. If
18 matches
Mail list logo