Re: [R] Using R Studio Version 0.98.507, having trouble with read.table and an Excel CSV file, keep getting '+'

2014-06-21 Thread Steve Friedman
Hello Richard

Initially it appears that you left off a closing " mark at the end of the
file name.  Also why don't you use read csv?

Steve
On Jun 21, 2014 12:01 PM, "Richard Lerner"  wrote:

> I saved what I consider a medium size Excel file--about 2000x 40 as a CSV.
> I am NOT sure the save went well as it took over five minutes to do it
> (Intel i7 running at 240 GHz, 12 GB RAM).
>
> When I put in the following code , I get a "+" instead of ">".
>
> read.table("c:/users/Richard lerner/downloads/PAZ study.csv, sep =
> ",", header =TRUE)
>
>
>
> I have read the documentation on "read.table"
>
> Richard
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] stop subscribing mailing list

2014-05-21 Thread Steve Friedman
Then unsubscribe.
On May 21, 2014 10:00 AM, "han...@purdue.edu"  wrote:

> Dear,
>
> I would like to stop to receive any email from R-help mailing list for
> this email address. Thank you.
>
>
> Mingxuan Han
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Console Output Formatting

2013-09-04 Thread Steve Friedman
Depending on the OS you are working with awk or gawk are great utilities
for stripping columns from files.  Also if you use a spreadsheet it is
quite easy to drop a column.
On Sep 4, 2013 5:59 PM, "Noah Silverman"  wrote:

> Hi,
>
> Working with R, I often want to copy and paste some values somewhere else.
>  (Its not worth saving a CSV file for a dozen or so entries.)  Or, I may
> want to copy all the names of an object into some code.
>
> R, rather nicely, wraps output with an index number on the left side.
>
> For example:
>
> [1] -1.07781972 -1.12157840  1.79303276  1.53313388 -1.30854455
>  0.45641730  0.23866722 -1.96265084
>   [9] -1.90779578 -0.68418936 -2.04910282  0.12008358 -1.71072687
> -0.36707605 -0.36939204 -2.02799948
>  [17]  0.36466562 -1.34204214 -0.45100125 -0.60483154  0.42208268
> -0.89535576 -1.09398009 -2.07257728
>  [25] -0.04615273 -0.23659570  0.27232736  1.28432538 -2.17042948
> -0.45364579  1.52957528  0.39838320
>  [33]  0.64923323 -1.01651051 -0.36287974 -0.73787761  0.48088199
> -1.19539814 -0.80079095 -1.02507331
>
>
>
> While this is great to read on screen, it is a pain to have to edit out
> all the index numbers.
>
> Is there a simple way to just back the values, or even a comma separated
> list of the values?
>
>
>
> Thanks!
>
>
>
> --
> Noah Silverman, M.S., C.Phil
> UCLA Department of Statistics
> 8117 Math Sciences Building
> Los Angeles, CA 90095
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to install R 3.0.1

2013-05-31 Thread Steve Friedman
Thanks for the clarification.
On May 31, 2013 10:19 AM, "Prof Brian Ripley"  wrote:

> On 31/05/2013 14:44, Steve Friedman wrote:
>
>> You can't. You must copy them to the new installation directory. After
>> that
>> you can use the update package command to check for and install the
>> upgrades packages.
>>
>
> Not so if you organized your packages sensibly in a separate library. See
> http://cran.r-project.org/bin/**windows/base/rw-FAQ.html#What_**
> 0027s-the-best-way-to-upgrade_**003f<http://cran.r-project.org/bin/windows/base/rw-FAQ.html#What_0027s-the-best-way-to-upgrade_003f>(and
>  the rest of that FAQ).
>
>
>
>  On May 31, 2013 9:43 AM, "Upananda Pani"  wrote:
>>
>>  Hi John,
>>>
>>> Thanks for your reply .How to Update all the packages ( Which i am
>>> already
>>> using ) automatically to the new version.?
>>>
>>>
>>> With regards,
>>> Upananda
>>>
>>>
>>>
>>>
>>>
>>> On Fri, May 31, 2013 at 7:01 PM, John Kane  wrote:
>>>
>>>  Sorry I misread your post.  Just download the 3.0.1 for Windows and
>>>> install.  You will need to reinstall any additional packages that you
>>>>
>>> have
>>>
>>>> installed.
>>>>
>>>> John Kane
>>>> Kingston ON Canada
>>>>
>>>>
>>>>  -Original Message-
>>>>> From: upananda.p...@gmail.com
>>>>> Sent: Fri, 31 May 2013 18:11:28 +0530
>>>>> To: r-help@r-project.org
>>>>> Subject: [R] how to install R 3.0.1
>>>>>
>>>>> Hi All,
>>>>>
>>>>> I want to switch over from 2.13.1 to 3.0.1. Is it advisable to switch
>>>>> over.
>>>>> I am using Windows Vista.
>>>>>
>>>>> Please suggest me installation procedure as i am not very comfortable
>>>>>
>>>> in
>>>
>>>> Installing R and If any good documentations can be found, Please send
>>>>>
>>>> me
>>>
>>>> the link.
>>>>>
>>>>> Thanks and Regards,
>>>>> Upananda
>>>>>
>>>>> --
>>>>>
>>>>>
>>>>> You may delay, but time will not.
>>>>>
>>>>>
>>>>> Research Scholar
>>>>> alternative mail id: up...@iitkgp.ac.in
>>>>> Department of HSS, IIT KGP
>>>>> KGP
>>>>>
>>>>>[[alternative HTML version deleted]]
>>>>>
>>>>> __**
>>>>> R-help@r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>>>>> PLEASE do read the posting guide
>>>>> http://www.R-project.org/**posting-guide.html<http://www.R-project.org/posting-guide.html>
>>>>> and provide commented, minimal, self-contained, reproducible code.
>>>>>
>>>>
>>>> __**__
>>>> FREE ONLINE PHOTOSHARING - Share your photos online with your friends
>>>> and
>>>> family!
>>>> Visit 
>>>> http://www.inbox.com/**photosharing<http://www.inbox.com/photosharing>to 
>>>> find out more!
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>>
>>>
>>> You may delay, but time will not.
>>>
>>>
>>> Research Scholar
>>> alternative mail id: up...@iitkgp.ac.in
>>> Department of HSS, IIT KGP
>>> KGP
>>>
>>>  [[alternative HTML version deleted]]
>>>
>>> __**
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/**posting-guide.html<http://www.R-project.org/posting-guide.html>
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>>
>> [[alternative HTML version deleted]]
>>
>> __**
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
> --
> Brian D. Ripley,  rip...@stats.ox.ac.uk
> Professor of Applied Statistics,  
> http://www.stats.ox.ac.uk/~**ripley/<http://www.stats.ox.ac.uk/~ripley/>
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to install R 3.0.1

2013-05-31 Thread Steve Friedman
You can't. You must copy them to the new installation directory. After that
you can use the update package command to check for and install the
upgrades packages.
On May 31, 2013 9:43 AM, "Upananda Pani"  wrote:

> Hi John,
>
> Thanks for your reply .How to Update all the packages ( Which i am already
> using ) automatically to the new version.?
>
>
> With regards,
> Upananda
>
>
>
>
>
> On Fri, May 31, 2013 at 7:01 PM, John Kane  wrote:
>
> > Sorry I misread your post.  Just download the 3.0.1 for Windows and
> > install.  You will need to reinstall any additional packages that you
> have
> > installed.
> >
> > John Kane
> > Kingston ON Canada
> >
> >
> > > -Original Message-
> > > From: upananda.p...@gmail.com
> > > Sent: Fri, 31 May 2013 18:11:28 +0530
> > > To: r-help@r-project.org
> > > Subject: [R] how to install R 3.0.1
> > >
> > > Hi All,
> > >
> > > I want to switch over from 2.13.1 to 3.0.1. Is it advisable to switch
> > > over.
> > > I am using Windows Vista.
> > >
> > > Please suggest me installation procedure as i am not very comfortable
> in
> > > Installing R and If any good documentations can be found, Please send
> me
> > > the link.
> > >
> > > Thanks and Regards,
> > > Upananda
> > >
> > > --
> > >
> > >
> > > You may delay, but time will not.
> > >
> > >
> > > Research Scholar
> > > alternative mail id: up...@iitkgp.ac.in
> > > Department of HSS, IIT KGP
> > > KGP
> > >
> > >   [[alternative HTML version deleted]]
> > >
> > > __
> > > R-help@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> >
> > 
> > FREE ONLINE PHOTOSHARING - Share your photos online with your friends and
> > family!
> > Visit http://www.inbox.com/photosharing to find out more!
> >
> >
> >
>
>
> --
>
>
> You may delay, but time will not.
>
>
> Research Scholar
> alternative mail id: up...@iitkgp.ac.in
> Department of HSS, IIT KGP
> KGP
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading CSV file

2013-04-19 Thread Steve Friedman
Make sure you have the correct path to the file.
On Apr 19, 2013 10:53 AM, "Gafar Matanmi Oyeyemi" 
wrote:

> I am trying to read a csv file using the code;
> contol <- read.csv("RBS.csv")
> This is the error message I got;
> Error in file(file, "r") : unable to open connection
> In addition: Warning message:
> In file(file, "r") :
> cannot open file 'RBS.csv', reason 'No such file or directory'
>
>
> Where was the mistake?
>
> --
> OYEYEMI, Gafar Matanmi (Ph.D)
> Senior Lecturer
> Department of Statistics
> University of Ilorin.
> Area of Specialization: Multivariate Analysis, Statistical Quality Control
> & Total Quality Management.
> Tel: +2348052278655, +2348068241885
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] read.delim

2013-04-02 Thread Steve Friedman
You have to tell R what the column delimiter is.  See Read.table.
On Apr 2, 2013 8:28 AM, "Shane Carey"  wrote:

> Hi,
>
> Im reading in a .txt file into R that consists of 5 columns, however, when
> imported into R, it reads all the data into just one column. Is there a way
> of telling R to create a dataframe with 5 columns rather than putting all
> the data into one column?
>
> Thanks
>
> --
> Shane
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to count the nos. in a range?

2012-12-20 Thread Steve Friedman
Have considered  "cut" and "table" ?
On Dec 20, 2012 12:08 PM, "Katherine Gobin" 
wrote:

> Dear R forum
>
>
> I have a following vector of random no.s
>
> x = runif(100, 0.01, 0.99)
>
>
>  [1] 0.47212037 0.77867992 0.33947474 0.93369035
>   [5] 0.03720073 0.79307831 0.81801835 0.92710688
> .
>
>
> I need to count the random no. falling in the range (0 - 0.10), (0.10 -
> 0.20), (0.20 - 0.30)..upto (0.90 - 1)
>
>
> Thus, I
>  need to have a data frame as
>
> range
>  frequency
> 0 - 0.10  ...
> 0.10 - 0.20
>  ...
> ..
>
>
> 0.90 - 1 .
>
> I understand I need to write my code and ask for some help if the need be.
> But I am simply clueless at the moment.
>
> Kindly guide.
>
> Katherine
>
> [[alternative HTML version deleted]]
>
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-package "FunctSNP"

2012-08-21 Thread Steve Friedman
Did you download the zip file to your computer?   Next install from zip
file.
On Aug 21, 2012 9:06 AM,  wrote:

> Hy everyone,
>
> I am new in R so I will pose a simple question that I cannot find out
> reading tutorials.
> I would like to install the R-package "FunctSNP" by file.zip because it´s
> in the archive (http://ftp.sunet.se/pub/lang/**CRAN/src/contrib/Archive/**
> FunctSNP/
> )
> but It doesn´t work, I think some problem concernings library.
>
> Could someone show me how to do?
>
> Thanks
>
> LT
>
> __**
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/**
> posting-guide.html 
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Plotting skewed normal distribution with a bar plot

2011-11-04 Thread Steve Friedman
Hi Michael,

Thanks for pointing me fGarch.  I actually started there, but it is not yet
available for 2.13.2 so I went directly to the (sn-package).

I've briefly explored your suggestion and think it will work.

Thanks
Steve
On Nov 3, 2011 10:41 PM, "R. Michael Weylandt" 
wrote:

> It seems like you'll need to apply some sort of MLE to estimate the
> parameters directly from the data before using dsn() to get the
> density. This might help with some of it:
> http://help.rmetrics.org/fGarch/html/snorm.html
>
> Michael
>
> On Thu, Nov 3, 2011 at 2:54 PM,   wrote:
> >
> > Hi,
> >
> > I need to create a plot (type = "h")  and then overlay a skewed-normal
> > curve on this distribution, but I'm not finding a procedure to accomplish
> > this. I want to use the plot function here in order to control the bin
> > distributions.
> >
> > I have explored the sn library and found the dsn function.  dsn uses
> known
> > location, scaling and shape parameters associated with a given input
> vector
> > of probabilities.  However, how can I calculate the skewed-normal curve
> if
> > I don't know these parameters in advance?
> >
> > Is there another function to calculate the skew-normal, perhaps in a
> > different package?
> >
> >
> > I'm working with R 2.13.2 on a windows based machine.
> >
> > Steve Friedman Ph. D.
> > Ecologist  / Spatial Statistical Analyst
> > Everglades and Dry Tortugas National Park
> > 950 N Krome Ave (3rd Floor)
> > Homestead, Florida 33034
> >
> > steve_fried...@nps.gov
> > Office (305) 224 - 4282
> > Fax (305) 224 - 4147
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] moving mean and moving variance functions

2011-04-04 Thread Steve Friedman
Hello


Lets say as an example I have a dataframe with the following attributes:
rownum(1:405), colnum(1:287), year(2000:2009), daily(rownum x colnum x year)
and foragePotential (0:1, by 0.01).  The data is actually stored in a netcdf
file and I'm trying to provide a conceptual version of the data.

Ok. I need to calculate a moving mean and a moving variance for each cell on
the following temporal
windows - 7 day, 14 day, and 28 day. So far I have code for the moving
average.

ma <- function(x , n) {
  filter(x, rep(1/n, n), sides = 1)
  }   # note that when the function is used, n is defined for the
temporal period (7, 14, and 28), and x is the input variable.


ma7 <-   ma(dat, 7)  # where dat is accessing the foraging potential of the
birds.
ma14 <- ma(dat, 14)
ma28 <- ma(dat, 28)

This works fine.  What I don't have is the code for a moving variance.

filter in the function above is included in the stats package and conducts a
linear filtering on a Time Series.

Is there comparable code some place in R for a moving variance?

Thanks in advance.

Thanks,
Steve

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] installing ncdf on Ubuntu 10.04

2011-04-03 Thread Steve Friedman
Hello

I'm trying to install the "ncdf" package on a Ubuntu 10.04 laptop.

Can you offer suggestions to install this package?


> install.packages("ncdf", repositories = TRUE)
Installing package(s) into ‘/home/steve/R/i486-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
Error in download.file(url, destfile, method, mode = "wb", ...) :
  unused argument(s) (repositories = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package 'ncdf' failed

> install.packages("ncdf")
Installing package(s) into ‘/home/steve/R/i486-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
trying URL 'http://cran.mirrors.hoobly.com/src/contrib/ncdf_1.6.5.tar.gz'
Content type 'application/x-gzip' length 78738 bytes (76 Kb)
opened URL
==
downloaded 76 Kb

* installing *source* package ‘ncdf’ ...
checking for nc-config... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking netcdf.h usability... no
checking netcdf.h presence... no
checking for netcdf.h... no
configure: error: netcdf header netcdf.h not found
ERROR: configuration failed for package ‘ncdf’
* removing ‘/home/steve/R/i486-pc-linux-gnu-library/2.12/ncdf’

The downloaded packages are in
‘/tmp/Rtmpt709vH/downloaded_packages’
Warning message:
In install.packages("ncdf") :
  installation of package 'ncdf' had non-zero exit status



Thank you
Steve

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] NetCDF - rolling means and StdDev

2011-03-26 Thread Steve Friedman
Hello,

I am trying to come up with a routine to calculate a rolling mean and
standard deviation for three parameters stored in a NetCDF file.  The NetCDF
file contains 10 years of daily records for each of the three parameters,
and I need the statistics for each of the three parameters.

Below I include some code illustrating what I've done so far. Obviously this
approach does not get at the problem. It loops thru the data, to get to the
daily data, but stops short of trying to get the running mean/standard
deviation, an assignment that came after I developed the approach shown
here.

Where should the rolling mean and standard deviation functions be integrated
in the script, and what recommendations - approach can you offer to
accomplish this task.

I am running this on a Windows 7 machine with R 2.12.2
Thanks for taking the time to help.

Steve


setwd("C:\\Woodstorks")
getwd()


library(tis) #  includes function for leap year
library(ncdf)

 woodstorks <- open.ncdf("WoodStork_Eden_2000_2009.nc")

 print(woodstorks)

  print(v2)

# next two lines create index values for temporal sequences.
 DaysToMonth365 <- c(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,
365)
 DaysToMonth366 <- c(0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335,
366)

Lyear <- isLeapYear(2000:2009) #  returns boolean TRUE FALSE vector for
years in sequence


#  next function is used latter in script see line 50
  processMonth<-function(x){
print(x)
  }

 start_year<- 1999

# initiates 1 year before to capture December of correct year, next line
uses the for loop to run thru
# the number of years. Here 3 is used to limit the number used in a testing
mode.

   for(t in 1:3) {
   currentYear = start_year + t
   leapYear <- isLeapYear(currentYear:currentYear) #  returns boolean vector
TRUE FALSE for years in sequence
   #print(leapYear)
Days<-DaysToMonth365
  if(leapYear){
 Days<-DaysToMonth366
   }
  print(Days)
  data <- array(data, dim = c(Days[1], 405, 265))
 for(d in 1: 226) {
   for(y in 1: 405) {
 for(x in 1:287) {
  Day = 1
  counter <- 2  # first element in array
#print(paste("Day = ", d))
   if(d >= Days[counter]) {
   counter <- counter + 1
   #print(paste("here = ", t))
   processMonth(data)
   data <- array(data, dim = c(Days[1], 405, 265))
Day = 1
print(Day)
 }
   else
   {
   index<-c(x,y,d,t)
   count<-c(1,1,1,1)
   temp<-  get.var.ncdf(woodstorks, v2, start=index, count =
count)
   i <- (d*405*287) + (y*287) + x #map 3d to 1dimension
   data[i] = temp[1]
   #print(data[i])
   Day <- Day + 1
   print(Day)
  }
   }
   }
 }
  }

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] nonparametric density and probability methods

2010-06-12 Thread Steve Friedman
Hello,

I tried to post this earlier, but it seems that it did not appear on the
list. If you've rec'd 2 m

I'm trying to calculate non-parametric probabilities using the np package
and having some difficulties.
OS is Windows, R version 2.11.1

Here is what I've done so far.

library(np)

veg <- data.frame(factor(Physiogomy), meanAnnualDepthAve, TP)

attach(veg) : for clarification dim(veg) returns 1292 3

fy.x <- npcdens(veg$factor.Physiogomy ~ veg$meanAnnualDepthAve, nmulti=1)
#  this works, but I haven't found any information explaining what the
nmulti=1 term is doing?  Does this set the number of levels in the factor?
My data actually has 8 types, can I develop this to treat each one in a
single function ?

veg.eval <- data.frame(Physiogomy = factor('Marl"}, meanAnnualDepthAve =
seq(min(meanAnnualDepthAve), max(meanAnnualDepthAve))
#  This also works, however where does the 4755 records originate

str(veg.eval)
' data.frame':   4755 obs of 2 variables
 $  Physiogomy: factor w / 1 level  "Marl" :   1   1
1  1  
 $ meanAnnualDepthAve : num   -592, -591 - 590  - 578

because the data frame veg only contains 1292 records the is a mismatch
between the 4755 records.  Why are so many records produced in the veg.eval
statement and how can i constrain it to be consistent with the dimensions of
veg ?

plot(x, y, type = "l", lty="2", col='red' , xlab = "Mean Annual Depth",
ylab="Estimated Prob of Marl")
 lines(veg.eval$
meanAnnualDepthAve, predict(fy.x, newdata=veg.eval), col='blue')

I'm following an example I found Here:
http://en.wikipedia.org/wiki/Density_estimation

Your help is greatly appreciated.

Thanks
Steve

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] help with npcdens function package np

2010-06-12 Thread Steve Friedman
Hello,

I'm trying to calculate non-parametric probabilities using the np package
and having some difficulties.
OS is Windows, R version 2.11.1

Here is what I've done so far.

library(np)

veg <- data.frame(factor(Physiogomy), meanAnnualDepthAve, TP)

attach(veg) : for clarification dim(veg) returns 1292 3

fy.x <- npcdens(veg$factor.Physiogomy ~ veg$meanAnnualDepthAve, nmulti=1)
#  this works, but I haven't found any information explaining what the
nmulti=1 term is doing?  Does this set the number of levels in the factor?
My data actually has 8 types, can I develop this to treat each one in a
single function ?

veg.eval <- data.frame(Physiogomy = factor('Marl"}, meanAnnualDepthAve =
seq(min(meanAnnualDepthAve), max(meanAnnualDepthAve))
#  This also works, however where does the 4755 records originate

str(veg.eval)
' data.frame':   4755 obs of 2 variables
 $  Physiogomy: factor w / 1 level  "Marl" :   1   1
1  1  
 $ meanAnnualDepthAve : num   -592, -591 - 590  - 578

because the data frame veg only contains 1292 records the is a mismatch
between the 4755 records.  Why are so many records produced in the veg.eval
statement and how can i constrain it to be consistent with the dimensions of
veg ?

plot(x, y, type = "l", lty="2", col='red' , xlab = "Mean Annual Depth",
ylab="Estimated Prob of Marl")
 lines(veg.eval$meanAnnualDepthAve, predict(fy.x, newdata=veg.eval),
col='blue')

I'm following an example I found Here:
http://en.wikipedia.org/wiki/Density_estimation

Your help is greatly appreciated.

Thanks
Steve

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] factanal: error message

2007-10-06 Thread Steve Friedman
Hi everyone,


I'm running a factor analysis on a correlation matrix with 32 rows and
columns.

I get the following error when I issue the command sequence

mich.fac1 <- factanal(michcor, factor=1)
Error in solve.default(cv) : system is computationally singular: reciprocal
condition number = 3.24729e-18


I'd really appreciate an explanation for this error and a solution to the
problem

Thanks
Steve

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] GWR modeling with dummy variables

2007-09-24 Thread Steve Friedman
Hi everyone,

I'm working with a modest sized spatial database consisting of 1513 records
and 50 variables.  Fourteen of these are dummy variables delineating
regional planning councils.  I'm trying to understand how to integrate the
dummy variables in the geographically weight regression model. I'm reading
Fotheringham et.al. and see reference to using dummy variables, but I don't
see an example ilustrating the procedure.  I also don't see an example in
the spgwr.pdf files associated with the package.

If anyone has experience with this I'd certainly like to hear from you.

I'm using R-2.5.1 on a PC.

Thanks in advance.

Steve

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.