similar to: questions on some operators in R

Displaying 20 results from an estimated 20000 matches similar to: "questions on some operators in R"

2007 Nov 08
1
Bug (?) in read.fwf
Hi, I'm trying to use read.fwf temp = read.fwf ("Raw data.txt", widths = c (11, 21, 10, rep (16, 6)) ,skip = 2, n = 2, stringsAsFactors = FALSE, strip.white = TRUE) but no matter what I do the strings are turned into factors. I believe it's the "n=2" parameter that causes the problem as it seems to work without this. Am I missing something? Thanks in advance,
2008 Aug 11
1
A zoo question / problem
Hi I'm having a problem using the zoo library and I can't see what I'm doing wrong. For example setting up the data > t1 = zoo (matrix (1:12, nrow = 3), order.by = as.Date (c("2008-08-01","2008-08-02","2008-08-03"))) > colnames (t1) = c ("A", "B", "C", "D") > t2 = zoo (matrix (1:12, nrow = 3), order.by =
2011 Jun 21
2
Documentation
I am new in R. Can anyone tell : 1. how we can write our own functions in R ? 2. how we can save those functions and recall to use them? 3. what extensions are used for saving a file? -- Siddharth Arun, 4th Year Undergraduate student Industrial Engineering and Management, IIT Kharagpur [[alternative HTML version deleted]]
2010 Oct 27
2
Which version control system to learn for managing Rprojects?
Gabor As someone trying to the rest of my team using Subversion (which I have used for a while, but more as a backup / record of changes), have you a neat / automated way of building a package from a subversion repository? Thanks David Jessop -------------------------- David Jessop Global Head of Quantitative Research UBS Investment Research +44 20 7567 9882 ----- Original Message -----
2010 Jun 20
6
Popularity of R, SAS, SPSS, Stata...
Hi All, I've been fiddling around with various ways to estimate the popularity of R, SAS, SPSS, Stata, JMP, Minitab, Statistica, Systat, BMDP, S-PLUS, R-PLUS and Revolution R. It's not an easy task. You can see what I've come up with so far at http://r4stats.com/popularity . I'm sure people will have plenty of ideas on how to improve this, so please let me know what you think.
2006 Jul 07
3
Converting data frame to zoo
Dear list, I know this is really basic question but I just couldn't get anything to work. (I did a R site search with keywords "zoo" and "data frame" but the server timed out on me.) I have a time series which has the following (typical) format, DATE Open High Low Close Volume 01-JAN-2006 5.25 5.25
2006 Aug 25
5
Quickie : unload library
Dear list, I know it must be obvious and I did my homework. (In fact I've RSiteSearched with keyword "remove AND library" but got timed out.(why?)....) How do I unload a library? I don't mean getting ride of it permanently but just to unload it for the time being. A related problem : I have some libraries loaded at startup in .First() which I have in .Rprofile. Now, I exited R
2006 Aug 11
3
An apply and rep question
Hi list, I'm sure the explanation must be laughably simple to the experts out there, but I just could figure it out. I have a simple data frame that looks like, >head(da.off) DDate OffP 1 2005-01-01 41.23 2 2005-01-02 44.86 3 2005-01-03 44.86 4 2005-01-04 43.01 5 2005-01-05 45.47 6 2005-01-06 48.62 where the first column DDate currently is character, and OffP is numeric. I want
2007 Apr 24
4
Size of an object in workspace
Hi folks, Is there a function to show the size of an R object? eg. in Kbytes? Couple months ago Bendix Carstensen posted this marvelous little function lls(), which shows all objects in the current workspace by mode, class and 'size'. This is a wonderful enhancement to the build-in ls() already and I now have it sourced in my Rprofile.site at startup. The only drawback is,
2007 Feb 05
2
Rconsole - setting the size and location of Windows help files (Rgui)
Hi, Using the Rconsole file I can specify the size and location of the Rgui windows on NT. e.g. # Dimensions (in characters) of the console. rows = 51 columns = 100 How can I specify the size of the help windows that popups when I ask for help? e.g. '?help' I would like the popup window to have say rows = 51 and columns = 100, just like the main window but a different location on the
2010 Dec 23
2
problem installing R on ubuntu
Following the official instructions to install R on ubuntu 10.04, I issued this command on the prompt, sudo apt-get install r-base Here is the error msg, Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that
2006 Aug 10
2
day, month, year functions
Hi list, I'm trying to turn a date into something productive. (Not what you may be thinking....) I want three functions so I could take a "date" object and get the day of week, month, and year from it. xx <- as.Date("2006-01-05") month(xx) equal 1 day(xx) equal 5 year(xx) equal 2006 I'm aware of the weekdays() and months() functions in the base package. But
2007 Aug 21
1
small issue with densityplot
Hi folks, This is really minor but to someone not familiar with the various tentacles of the lmer package it could be really annoying. I was trying to plot the posterior density of the fixed effect parameters of a lmer model, > hr.mcmc = mcmcsamp(hr.lmer, n=50000) > densityplot(hr.mcmc, plot.points=F) There is this error, "Error in densityplot(hr.mcmc, plot.points = F) : no
2010 Jun 08
2
type conversion with apply or not
Folks, i thought it should be straightforward but after a few hours poking around, I decided it's best to post my question on this list. I have a data frame consisting of a (large) number of date columns, which are read in from a csv file as character string. I want to convert them to Date type. Following is an example, where the first column is of integer type, while the rest are type
2007 Jun 12
1
Viewing a data object
Dear list, First apologize that this is trivial and just betrays my slothfulness at the keyboard. I'm sick of having to type a long name just to get a glimpse of something. For example, if my data frame is named 'AuroraStochasticRunsJune1.df" and I want to see what the middle looks like, I have to type AuroraStochasticRunsJune1.df[ 400:500, ] And often I'm not even sure rows
2010 Jul 29
1
Crash report: projection pursuit & predict
Folks, The projection pursuit regression function in the base R seems to crash when the optimization level is set to zero, i.e. the initial ridge terms are accepted without refitting. I encountered this problem in an out-of-sample prediction exercise using predict. But further investigation suggests the issue is with the ppr fit and predict just sppeds up the crash. The other optlevels seem to be
2010 Oct 28
1
Key combination that removes all R objects
Dear readers, There is a combination of keys that I have (on several occasions now) typed by accident into R (2.10.0) which removes all the objects in the environment, and clears the console, as though I had typed rm(list=ls()). Unfortunately I don't know what the combination of keys are, so I am struggling to find out more about this behaviour on my own and I was hoping that someone has
2011 Feb 17
1
How to speed up a for() loop
Dear all, Does anyone have any idea on how to speed up the for() loop below. Currently it takes approximately 2 minutes and 30 seconds. Because of the size of Nsim and N, simulating a multivariate normal (instead of simulating Nsim times a vector of N normal distributions) would require too much memory space. Many thanks for your kind help, Simona N=3000 PD=runif(N,0,1) cutoff.=qnorm(PD)
2007 Aug 29
3
OT: distribution of a pathological random variate
Folks, I wonder if anything could be said about the distribution of a random variate x, where x = N(0,1)/N(0,1) Obviously x is pathological because it could be 0/0. If we exclude this point, so the set is {x/(0/0)}, does x have a well defined distribution? or does it exist a distribution that approximates x. (The case could be generalized of course to N(mu1, sigma1)/N(mu2, sigma2) and one
2008 Nov 25
3
Line color based on data values?
Hi all Does anyone know if it is possible when plotting a line or scatter plot, to selectively color the data points based on the data value? i.e. if plotting say the percentage change in stock price movements, to color +ve points in green and -ve points in red? And extending this to a user-defined range of colors based on the quartile of the data points? Thanks Rory Rory Winston RBS Global