Displaying 20 results from an estimated 20000 matches similar to: "Is there a way to save EVERYTHING in R?"
2011 May 03
1
Rodbc quesion: how to reliably determine the data type?
Hello,
How can I tell RODBC to scan all the records of an xls file to determine the
data type? If the first n records happen to be empty Rodbc assumes a character,
and any numbers are made <NA>. And if, for instance, the first n records contain
numbers, and later they also contain characters, those characters become NA.
Cheers!!
Albert-Jan
2011 Dec 06
1
RStudio: copied line is always not the same as the line that I highlighted
Hi all,
I am using RStudio. I wanted to copy and past an expression/line.
I highlighted it, and then copied and pasted:
The result was not the line that I wanted, instead, it was the line above...
For example:
I have three lines:
aaaaa
bbbbb
ccccc
....
I highlighted "bbbbb" and copied, but the pasted outcome was "aaaaa"...
What happened?
Thanks al ot!
[[alternative
2012 Jan 20
1
free memory in large list?
Hi all,
Lets say I have a huge list which is indexed in the following format:
mylist[[i]][[j]][[k]]
where the size is 100 x 100 x 100000
If I want to set
mylist[[2]][[3]]=NULL
How do I free the memory used by that sub-list?
Thanks a lot!
[[alternative HTML version deleted]]
2012 May 27
1
How do I modify sytem shell environment from within R?
Hi all,
Could you please tell me how do I modify the environment variable (as
below), from within R session?
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mypath
export LD_LIBRARY_PATH
Thanks a lot!
[[alternative HTML version deleted]]
2011 Nov 23
2
Is there an easier way to iterate over multiple data frames in R?
> for (d in paste('df', 1:3, sep='')) {
+ assign(d, as.data.frame(replicate(3, rnorm(4))))
+ }
> dats = list(df1,df2,df3)
> for (i in 1:length(dats)) {
+ names(dats[[i]]) = c('w', 'l', 'h')
+ }
> dats
[[1]]
w l h
1 1.24319239 -0.05543649 0.05409178
2 0.05124331 -1.89346950 0.33896273
3 -1.69686777 -0.35963008
2013 Aug 22
1
From POSIXct to numeric and back with time zone
From POSIXct to numeric and back with time zone
I am running regressions on data which has time series with different time resolution. Some data has hourly resolution, while most has either daily or weekly resolution. Aggregation is used to make the hourly data daily, while liner interpolation is used to find daily data from the weekly time series. This data manipulation requires some careful
2011 Nov 24
3
Is there way to add a new row to a data frame in a specific location
Is there easy way (without copying the existing rows to a temporary
location and copying back) to add a new row to a specific index location in
an existing data frame?
Example
df = data.frame( A= c('a','b','c'), B=c(1,2,3), C=(10,20,30))
newrow = c('X', 100, 200)
I want to add the newrow as the second row to the data frame df
Please suggest a solution that is
2010 Sep 07
5
R 2.11, shell, spaces
Can somebody confirm some unexpected behavior? This is under Windows,
with R 2.11.0 and 2.11.1.
1. Create a trivial test file (I called it test.R) containing:
cat("Success.\n")
2. Load R (Gui or Term) and run:
shell("\"C:\\path\\to\\Rscript.exe\" \"C:\\path\\to\\test.R\"")
In my case, I get various error messages. If the
path\\to\\Rscript.exe has spaces
2011 Aug 02
2
how to control to save plots to which dev
Hi,
I have a for loop to make 2 types of plots and I'd like to save one
type of plots to a pdf file and the other to another pdf file. How can
I control which plot will be saved to which pdf? Thanks
--
Best,
Zhenjiang
2011 Aug 25
1
Question about object permanence/marshalling
Hello,
I am trying to write some code that dumps R objects to the harddisk in a binary format so they can be quickly re-used later. Goal is to save time. The objects may be quite large (e.g. classes for a GUI). I was thinking that save() and load() would be suitable for this (until now I only thought it could be used for 'real' data, e.g. matrices, data.frames etc), but I am hoping any
2010 Aug 03
1
how to read/save .zip compressed files from R?
Dear list,
is there a way to open a .zip folder so that one can extract and
modify files inside and then save teh .zip folder again?
thanks!
Jose
--
Dr. Jose I. de las Heras Email: J.delasHeras at ed.ac.uk
The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131 6507095
Institute for Cell & Molecular Biology Fax: +44 (0)131 6507360
Swann Building,
2012 Oct 09
1
other way of making a table?
I'm making tables for prediction results of classifiers (2 classes) that show the usual numbers, true positives, false positives, etc
I used the command
table(predictedLabels,realLabels)
to make those.
I just had a case though ,where one of the label vectors had only one class in it. This will result in only half a table.
Compare:
x<-c(1,1,1,0,0)
y<-c(1,1,1,0,1)
table(x,y)
to
2012 Sep 19
3
effective way to return only the first argument of "which()"
Hi,
I was looking for a function like "which()" but only returns the first argument.
Compare:
x <- c(1,2,3,4,5,6)
y <- 4
which(x>y)
returns:
5,6
which(x>y)[1]
returns:
5
which(x>y)[1] is exactly what i need. I did use this but the dataset
is too big (~18 mio. Points).
That's why i need a more effective way to get the first element of a
vector which is
2013 Aug 25
3
POSIXct bug for conversion of specific combinations of date and time
Hello everyone,
I'm having a big trouble with which seems to be a bug in as.POSIXct()
date-time conversion. I have massive GPS datasets in which each location
has it's own date and time attribute. As I convert them to POSIXct format,
1300 cases (of about half a million locations) simply return NA values.
I picked up a small sample of failed cases and normal cases to demonstrate
the
2012 Nov 07
4
save/load and package namespaces
Could someone explain to me what namespaces are loaded/saved when objects
are saved?
Specifically, I'm using this:
save(list = ls(all.names = TRUE, envir = envir), file = name, envir =
envir)
to save out everything from an environment.
Later, loading it on another machine, I'm surprised to see the load failing
for being unable to load certain packages. Could anyone help me understand
2012 Feb 14
2
save objects of own function to workspace
Dear R-helpers,
I created an own function which looks like this
s_elternmz <- function(Var="balt")
{
Dg_a<-mz[,c("asbhh","apkz",Var)]
colnames(Dg_a)[colnames(Dg_a)=="apkz"]<-"bpkzm"
colnames(Dg_a)[colnames(Dg_a)==Var]<-paste(Var,"_m",sep="")
2012 Dec 06
2
Best way to coerce numerical data to a predetermined histogram bin?
Folks:
Say I have a set of histogram breaks:
breaks=c(1:10,15)
# With bin ids:
bin_ids=1:(length(breaks)-1)
# and some data (note that some of it falls outside the breaks:
data=runif(min=1,max=20,n=100)
***
What is the MOST EFFICIENT way to "classify" data into the histogram bins
(return the bin_ids) and, say, return NA if the value falls outside of the
bins.
By classify, I mean
2011 Oct 05
2
any way to convert back to DateTime class when "accidental" conversion to numeric?
Hi,
In short, I would like to know if there is any way to convert a numeric
into a date, similar to how strptime() can convert a string to a date time
class?
There are some functions, etc. which don't work well with dates, and
tend to force them into numerics. I understand that the number it spits
back is the number of seconds since the beginning of 1970 (see the first few
sentences
2012 Apr 23
2
.rda vs. .RData
Are they the same with .RData being the newer format?? Thanks,
...Tao
2012 May 27
1
SOS! R Console crashed after loading RODBC... Update: Re: How to set up RODBC? Diff between R Console and RStudio?
On Sun, May 27, 2012 at 11:32 AM, Michael <comtech.usa@gmail.com> wrote:
> Help! The R Console very quietly closed and exited without giving any
> errors/warnings...after I loaded the RODBC library...
>
> Loading required package: RODBC
>
>
>
>
> On Sat, May 26, 2012 at 10:27 PM, Michael <comtech.usa@gmail.com> wrote:
>
>> Hi all,
>>
>>